A fast prediction method for two-dimensional steady laminar flow field based on convolutional neural network
By constructing a two-dimensional fixed-normal laminar flow field rapid forecasting method based on convolutional neural network, the problem of high computing time and resource consumption in the existing technology is solved, and fast and accurate flow field forecasting is achieved, which improves the economic benefits of hull design.
Patent Information
- Application Number
- CN202211284825.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-17
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-10-17
AI Technical Summary
In the prior art, in the design of ship-type lines, the constant laminar flow field forecasting method consumes a lot of calculation time and resources, resulting in an extended design cycle and an increase in cost.
A two-dimensional fixed-normal laminar flow field rapid prediction method based on convolutional neural network is adopted. By constructing a convolutional neural network model, jump connections and hyperparameter adjustments are used to achieve rapid prediction of flow field velocity and pressure distribution.
It greatly shortens the design cycle, reduces calculation costs, improves the accuracy and efficiency of forecasts, and is suitable for rapid inspection of hull design.
Smart Images

Figure CN115630589B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of ship and ocean engineering, and more specifically, relates to a method for quickly predicting a two-dimensional steady laminar flow field based on a convolutional neural network. Background Art
[0002] Line design is a very critical part of the ship design process, and it has a very wide and far-reaching impact on ship performance.
[0003] The influence of line design on ship performance is mainly reflected in the following aspects:
[0004] The first is the ship's buoyancy. Both its load and buoyancy are directly affected by its buoyancy. A ship's load is closely related to its displacement, while its buoyancy is related to the position of its center of buoyancy. For a transport ship, a larger displacement means a greater cargo capacity. Furthermore, buoyancy affects the ship's resistance and propulsion efficiency during navigation. Appropriate trim can effectively reduce a ship's energy consumption, saving significant fuel costs.
[0005] The second is the stability of the ship. When a ship floats on the water, it is bound to be disturbed by the external forces of wind and waves and deviate from the equilibrium position. In this case, considering the safety and stability of the ship during transportation, the stability of the ship must be checked to ensure that the ship has the ability to maintain its original equilibrium state. In addition, the stability of the ship will also affect the comfort of the people on board. If the ship's recovery ability is too strong, it will cause the ship to shake frequently, causing strong discomfort to the crew. The calculation process of the ship's stability involves parameters such as the ship's cross-sectional inertia moment and displacement volume. These parameters are closely related to the hull profile shape and need to be considered in the corresponding design work.
[0006] The third factor is ship resistance. As a ship navigates the water, it is subject to the combined effects of wave resistance, frictional resistance, and viscous-pressure resistance. Wave resistance and viscous-pressure resistance are primarily affected by the ship's hull shape, while frictional resistance is related to the hull's wetted surface area. For cargo ships, reducing resistance can significantly reduce energy consumption during navigation, thereby significantly improving the ship's economic efficiency.
[0007] The fourth is ship propulsion. Currently, the most widely distributed and mainstream propulsion method in the shipping industry is the propeller. When calculating the propulsion efficiency of the propeller, the mutual influence between it and the hull needs to be taken into account. Among them, the influence of the hull on the propeller is manifested as wake, that is, because the nearby water is driven to move during the navigation of the ship, the relative speed of the propeller and the nearby water flow and the speed of the ship are different; the influence of the propeller on the hull is manifested as thrust reduction, that is, the propeller working behind the ship causes the pressure at the stern to decrease, and then a pressure difference occurs between the bow and stern of the hull, which brings resistance to the ship's navigation, which is equivalent to reducing the thrust of the propeller. Therefore, giving full play to the beneficial effects of wake and minimizing the thrust reduction of the propeller can effectively improve the propulsion efficiency of the hull, thereby improving the economic benefits of the ship.
[0008] The fifth factor is ship maneuverability, which is crucial for navigation safety. Throughout history, inflexible steering has been a major cause of numerous major accidents. Therefore, designing for ship maneuverability has become an essential step in ship design. Maneuverability is influenced by many factors, including ship parameters such as waterline length, principal aspect ratio, squareness, mid-section area, stern shape, and bow shape. It is also closely linked to the stern rudder. This inevitably requires extensive verification of the line design scheme.
[0009] Based on the above analysis, the design of the lines runs through the entire process of hull design. Therefore, carrying out the rapid prediction of the steady laminar flow field and providing fast and accurate prediction results for the corresponding design work is of great significance to the hull design work.
[0010] Existing methods for predicting steady laminar flow fields are primarily based on fluid mechanics theory, using computational fluid dynamics software to numerically solve the Navier-Stocks equations to determine the velocity and pressure distributions in the flow field. Due to the complexity of nonlinear differential equations, these methods require significant computational time and resources, significantly extending the design cycle and requiring relatively high research costs.
[0011] It can be seen from this that the existing technology has technical problems such as consuming a lot of computing time and computing resources, which leads to a significant extension of the corresponding design cycle and high research costs. Summary of the Invention
[0012] In response to the above-mentioned defects or improvement needs of the existing technology, the present invention provides a two-dimensional steady laminar flow field rapid prediction method based on convolutional neural network, thereby solving the technical problems in the existing technology that it consumes a lot of computing time and computing resources, resulting in a significant extension of the corresponding design cycle and high research costs.
[0013] To achieve the above objectives, according to one aspect of the present invention, a method for rapid prediction of a two-dimensional steady laminar flow field based on a convolutional neural network is provided, comprising:
[0014] The geometric information and boundary conditions of the flow field to be predicted are input into the two-dimensional steady laminar flow field rapid prediction model, and the flow field velocity and pressure distribution are output;
[0015] The two-dimensional steady laminar flow field rapid prediction model is trained in the following way:
[0016] Extract the waterplane contours of hulls with different shapes and aspect ratios at different depths from the hull lines to obtain two-dimensional hull profile data;
[0017] Integrate the two-dimensional hull profile data and fixed flow field boundary conditions to form flow field geometry information and boundary conditions, and solve the flow field velocity and pressure distribution based on the flow field geometry information and boundary conditions;
[0018] An encoder is composed of multiple convolutional layers and pooling layers, and a decoder is composed of multiple deconvolutional layers and depooling layers. Skip connections are established between some convolutional layers of the encoder and some deconvolutional layers of the decoder to construct a convolutional neural network.
[0019] The flow field geometric information and boundary conditions are used as the input data of the convolutional neural network. The encoder encodes the input data, and the decoder decodes the data output by the encoder by concatenating the data transmitted by the jump connection with the data obtained by depooling and then deconvolving. The hyperparameters of the convolutional neural network are adjusted before each training. When the error between the flow field velocity and pressure distribution output by the convolutional neural network and the solved flow field velocity and pressure distribution is less than the preset value, a two-dimensional steady laminar flow field rapid prediction model is obtained through training.
[0020] Furthermore, the input data of the convolutional neural network is obtained in the following manner:
[0021] Acquire multiple edge point coordinates of the hull section from the two-dimensional hull section data, calculate the distance between each sampling point in the two-dimensional hull section data and each edge coordinate point one by one, take the minimum distance between each sampling point and the edge coordinate point as its signed distance function value, and set the signed distance function value of the sampling point inside the hull section to 0. Thus, the signed distance function values of all sampling points in the two-dimensional hull section data form a signed distance function graph with the central obstacle as the boundary;
[0022] The coordinates of the upper and lower boundaries of the flow field are obtained from the fixed flow field boundary conditions. The vertical distance from each sampling point in the two-dimensional hull profile data to the upper and lower boundaries of the flow field is calculated one by one. The minimum vertical distance is used as the signed distance function value to form a signed distance function graph with the upper and lower boundaries as the boundaries.
[0023] Different values are assigned to the inside and outside of the hull section and the upper and lower boundaries of the flow field to form a flow field marker map.
[0024] The signed distance function graph with the central obstacle as the boundary, the signed distance function graph with the upper and lower boundaries, and the watershed marker graph constitute the flow field geometric information and boundary conditions, which serve as the input data of the convolutional neural network.
[0025] Furthermore, the training also includes expanding the input data of the convolutional neural network, including:
[0026] All hull lines are standardized according to the hull length to keep the length consistent; the hull section is scaled in the length or width direction, so that one direction undergoes a series of changes while the other direction remains unchanged, thereby changing the hull section shape, expanding the two-dimensional hull section data, and then expanding the input data of the convolutional neural network.
[0027] Furthermore, the output data of the convolutional neural network includes: a transverse velocity distribution map, a longitudinal velocity distribution map, and a pressure distribution map.
[0028] Furthermore, the encoder in the convolutional neural network includes a plurality of convolutional layers, a first pooling layer, a plurality of convolutional layers, a second pooling layer, a plurality of convolutional layers, and a third pooling layer connected in sequence;
[0029] The decoder includes: a first depooling layer, a plurality of deconvolution layers, a second depooling layer, a plurality of deconvolution layers, a third depooling layer, and a plurality of deconvolution layers connected in sequence;
[0030] A skip connection is established between the last convolutional layer in the multiple convolutional layers and the first deconvolutional layer in the multiple deconvolutional layers.
[0031] Furthermore, a first deconvolution layer of the multiple deconvolution layers is configured with an additional channel for transmitting data.
[0032] Furthermore, the hyperparameters include learning rate, convolution kernel size, channel number distribution, and number of convolution layers.
[0033] According to another aspect of the present invention, a two-dimensional steady laminar flow field rapid prediction system based on a convolutional neural network is provided, comprising:
[0034] The training data construction module is used to extract the waterplane profiles of hulls with different shapes and aspect ratios at different depths from the hull lines to obtain two-dimensional hull profile data; the two-dimensional hull profile data is integrated with fixed flow field boundary conditions to form flow field geometry information and boundary conditions, and the flow field velocity and pressure distribution are solved based on the flow field geometry information and boundary conditions;
[0035] A network construction module is used to construct an encoder by combining multiple convolutional layers and pooling layers, and a decoder by combining multiple deconvolutional layers and depooling layers. Skip connections are established between some of the convolutional layers of the encoder and some of the deconvolutional layers of the decoder to build a convolutional neural network.
[0036] The training module is used to use the flow field geometry information and boundary conditions as the input data of the convolutional neural network. The encoder encodes the input data, and the decoder decodes the data output by the encoder by concatenating the data transmitted by the jump connection with the data obtained by depooling and then deconvolving. The hyperparameters of the convolutional neural network are adjusted before each training. When the error between the flow field velocity and pressure distribution output by the convolutional neural network and the solved flow field velocity and pressure distribution is less than the preset value, the two-dimensional steady laminar flow field rapid prediction model is obtained through training;
[0037] The prediction module is used to input the geometric information and boundary conditions of the flow field to be predicted into the two-dimensional steady laminar flow field rapid prediction model, and output the flow field velocity and pressure distribution.
[0038] Furthermore, the training data construction module includes:
[0039] An input data acquisition module is used to obtain the coordinates of multiple edge points of the hull section from the two-dimensional hull section data, calculate the distance between each sampling point in the two-dimensional hull section data and each edge coordinate point one by one, take the minimum distance from each sampling point to the edge coordinate point as its signed distance function value, and set the signed distance function value of the sampling point inside the hull section to 0. As a result, the signed distance function values of all sampling points in the two-dimensional hull section data form a signed distance function graph with the central obstacle as the boundary; obtain the coordinates of the upper and lower boundaries of the flow field from the fixed flow field boundary conditions, calculate the vertical distance from each sampling point in the two-dimensional hull section data to the upper and lower boundaries of the flow field one by one, and take the minimum vertical distance as its signed distance function value to form a signed distance function graph with the upper and lower boundaries as the boundaries; assign different values to the inside and outside of the hull section and the upper and lower boundaries of the flow field to form a watershed labeling map, and the signed distance function map with the central obstacle as the boundary, the signed distance function map with the upper and lower boundaries as the boundaries, and the watershed labeling map constitute the flow field geometric information and boundary conditions as the input data of the convolutional neural network;
[0040] The real data calculation module is used to calculate the flow field geometry information and boundary conditions using fluid mechanics software to obtain the flow field velocity and pressure distribution.
[0041] Furthermore, the input data acquisition module is also used to standardize all hull lines according to the hull length so that their lengths remain consistent; scale the hull section in the length or width direction so that one direction undergoes a series of changes while the other direction remains unchanged, thereby changing the hull section shape, expanding the two-dimensional hull section data, and further expanding the input data of the convolutional neural network.
[0042] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0043] (1) The present invention adds jump connections on the basis of convolutional neural networks, which is used to make part of the data not undergo convolution and pooling steps during the encoding process, but directly splice with the data after convolution and pooling. The advantage of this approach is to reduce the loss of data caused by processes such as convolution and pooling, so that the forecast results contain more initial information, and ultimately improve the forecast effect. The present invention adjusts the hyperparameters before training so that the model performance meets the accuracy requirements and further improves the forecast effect. The fast and sufficiently accurate forecast results provided by the model of the present invention can efficiently test various design schemes and provide convenience for hull designers; compared with traditional computational fluid dynamics software, the computing resources required for convolutional neural networks to predict flow fields are very small, so the computing cost spent on testing schemes can be greatly reduced, so that the corresponding design cycle is greatly shortened, and the economic benefits brought by hull design are improved.
[0044] (2) To convert the acquired data into a dataset for model training, the input and output data need to be preprocessed separately. For the input data, it is necessary to generate a signed distance function graph with the central obstacle as the boundary, a signed distance function graph with the upper and lower boundaries as the boundaries, and a flow field marker graph to form the flow field geometry information and boundary conditions based on the two-dimensional hull profile data and fixed flow field boundary conditions; for the output data, it is necessary to calculate the velocity and pressure information of the flow field. In order to solve the problem that the number of hull line drawings is small and it is impossible to generate enough hull sections, the hull sections extracted from the line drawings have been deformed to expand the training data.
[0045] (3) The basic structure of the model of the present invention is a convolutional neural network, which can inherit the characteristics of shared weights and sparse connections of convolutional neural networks, making it much faster than traditional fully connected neural networks in the process of training and prediction. The input image is first encoded by an encoder composed of several convolution-pooling layers to extract the feature information contained in the original data, and then these feature information are decoded by a decoder composed of several depooling-deconvolution layers. Among them, several additional channels for transmitting information are added between the specific convolutional layers / deconvolution layers of the encoder / decoder - these channels will directly copy the image obtained by the convolution layer, send it to the subsequent deconvolution layer and splice it with the depooled image, so that the number of channels is doubled, which is called jump connection, which helps to improve the prediction accuracy. The hyperparameters involved in the hyperparameter adjustment process include learning rate, convolution kernel size, number of convolution layers and channel number distribution, thereby improving training efficiency and training accuracy.
[0046] (4) On an Intel Core i7 8550U processor, a single sample was simulated using the traditional method, with a time step of 5s, a simulation duration of 3000s, and eight-core parallel computing. The simulation took 341.4s. On the same device, 300 samples were simulated using the neural network model trained by the present invention. The total simulation time was 272.4s, with an average single sample time of 0.91s, significantly shortening the prediction time. In the context of today's shipbuilding industry vigorously promoting innovation and development, more and more new designs have entered the public's field of vision, and correspondingly, a large amount of verification work has been done on various design schemes. Therefore, how to conduct rapid and efficient simulation verification of these schemes has become an urgent problem to be solved in the optimization design of line in recent years. Therefore, the rapid and accurate prediction technology of the present invention has a strong application prospect and good economic value. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a flow chart of a method for rapid prediction of a two-dimensional steady laminar flow field based on a convolutional neural network provided by an embodiment of the present invention;
[0048] Figure 2 is a cross-sectional view of a hull at different waterplane depths under a specific aspect ratio provided by an embodiment of the present invention;
[0049] Figure 3 (a) is a signed distance function diagram formed with a central obstacle as the boundary provided by an embodiment of the present invention;
[0050] Figure 3 (b) is a watershed marking diagram provided by an embodiment of the present invention;
[0051] Figure 3(c) is a signed distance function diagram formed by upper and lower boundaries provided by an embodiment of the present invention;
[0052] Figure 4 (a) is a lateral velocity distribution diagram provided by an embodiment of the present invention;
[0053] Figure 4 (b) is a longitudinal velocity distribution diagram provided by an embodiment of the present invention;
[0054] Figure 4 (c) is a pressure distribution diagram provided by an embodiment of the present invention;
[0055] Figure 5 2 is a structural diagram of a convolutional neural network provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
[0057] like Figure 1 As shown, a two-dimensional steady laminar flow field rapid prediction method based on convolutional neural network includes:
[0058] The geometric information and boundary conditions of the flow field to be predicted are input into the two-dimensional steady laminar flow field rapid prediction model, and the flow field velocity and pressure distribution are output;
[0059] The two-dimensional steady laminar flow field rapid prediction model is trained in the following way:
[0060] Extract the waterplane contours of hulls with different shapes and aspect ratios at different depths from the hull lines to obtain two-dimensional hull profile data;
[0061] Integrate the two-dimensional hull profile data and fixed flow field boundary conditions to form flow field geometry information and boundary conditions, and solve the flow field velocity and pressure distribution based on the flow field geometry information and boundary conditions;
[0062] An encoder is composed of multiple convolutional layers and pooling layers, and a decoder is composed of multiple deconvolutional layers and depooling layers. Skip connections are established between some convolutional layers of the encoder and some deconvolutional layers of the decoder to construct a convolutional neural network.
[0063] The flow field geometric information and boundary conditions are used as the input data of the convolutional neural network. The encoder encodes the input data, and the decoder decodes the data output by the encoder by splicing the data transmitted by the jump connection with the data obtained by depooling and then deconvolving. The hyperparameters of the convolutional neural network are adjusted before each training. When the error between the flow field velocity and pressure distribution output by the convolutional neural network and the solved flow field velocity and pressure distribution is less than the preset value (ranging from 1% to 20%), a two-dimensional steady laminar flow field rapid prediction model is obtained through training.
[0064] The waterline profiles of hulls with different shapes and aspect ratios at different depths are extracted from the hull lines to obtain two-dimensional hull profile data, such as Figure 2 As shown in the figure. The hull lines are derived from Wigley's hull line formula and other types of transport ship line diagrams, such as oil tankers and bulk carriers. Preferably, to address the problem of insufficient hull sections due to the limited number of hull line diagrams, the hull sections extracted from the line diagrams are deformed. Specifically, first, all lines are standardized according to the hull length to maintain a consistent length. Second, the hull sections are scaled in either length or width, resulting in a series of changes in one direction while leaving the other unchanged. This allows the hull section shape to be altered, thereby expanding the dataset.
[0065] The 2D hull profile data and fixed flow boundary condition information are integrated to form a data file containing the flow field geometry and boundary conditions. Based on the flow field geometry and boundary conditions, batch calculation files are generated and sent to OpenFOAM for calculation to determine the flow field velocity and pressure distribution.
[0066] To enhance the adaptability of the neural network model, the training dataset contains 1,000 samples with varying aspect ratios and waterplane depths. For this massive data generation task, using scripts to batch generate 2D hull sections is a promising approach. gmsh, a mesh generator that supports both scripting and visual editing, is well-suited for this task. Generating hull sections requires first creating basic points, then connecting them to form basic lines. The number of nodes on each line must be set. Then, by selecting surrounding boundary lines, basic surfaces are created. Finally, the selected basic surfaces are extruded to form a 3D mesh image of the entire watershed, completing the creation of the geometry file containing the mesh information. This process can be performed either through a GUI interface or by editing the corresponding geometry file. In this work, geometry file generation is implemented using Python code. This code primarily utilizes Python file editing functions and uses nested for loops to modify ship parameters, enabling repeated clearing and rewriting of old geometry files.
[0067] After the geo file is generated, it can be converted into a mesh file - msh file through the conversion command provided by gmsh. However, this file cannot be directly recognized by openFOAM. New commands need to be run to convert the msh file into a polyMesh file that can be recognized by openFOAM.
[0068] The flow field data is calculated and generated using the computational fluid dynamics software openFOAM. After preparing the mesh file, it is necessary to modify the boundary file in polyMesh and set the boundary conditions and initial state of the flow field. In addition, since the mesh distribution is not uniform, and the model requires flow field information at coordinate points that are regularly arranged at equal intervals, sampling points must be set inside the flow field to monitor the flow velocity and pressure at that location. In this work, it was decided to use the internalCloud tool to monitor the flow field data. This tool can generate data at the sampling point by interpolating the data of the grid points near the sampling point. Compared with another probe tool that monitors the grid unit closest to the sampling point, it is more suitable for this monitoring task. After the calculation file is set up, the steady laminar flow solver icoFoam is used for calculation. The simulation time is 3000s. After the calculation is completed, a csv file containing the flow field information can be obtained.
[0069] To transform the acquired data into a dataset suitable for model training, both the input and output data must be preprocessed. For the input data, corresponding flow field boundary conditions and hull profile data must be generated for different hull profiles. For the output data, velocity and pressure information for the flow field must be extracted from the CSV file. Once these steps are complete, the two types of data can be combined to form a data package. The following details the preprocessing process for both input and output data:
[0070] like Figure 3 (a) Figure 3 (b) and Figure 3 As shown in (c), the input data includes a signed distance function graph formed with the central obstacle as the boundary, a watershed label graph, and a signed distance function graph formed with the upper and lower boundaries.
[0071] The process for generating a Signed Distance Function (SDF) image is as follows: Generating an SDF image that considers upper and lower boundaries is relatively simple, as values are assigned one by one based on the locations of the sampling points. However, generating an SDF image that considers the hull profile involves first generating a list of the coordinates of several edge points along the hull profile, then calculating the distance between each sampling point and all the points in the list and taking the minimum value. For sampling points within the hull profile, their values are simply set to 0. The process for generating a watershed marker image is similar to that for SDF images that consider upper and lower boundaries, where values are assigned one by one based on the locations of the sampling points.
[0072] like Figure 4 (a) Figure 4 (b) and Figure 4 As shown in (c), the output data includes the transverse velocity distribution map, the longitudinal velocity distribution map, and the pressure distribution map;
[0073] Since we've already obtained the CSV file generated by internalCloud in the previous step, we now simply need to extract the information from it and format it for the model to recognize. The specific process is as follows: First, use the pandas toolkit to read the CSV file, obtaining the coordinates, velocity, and pressure information contained in the file. Then, based on the coordinates of the sampling points, the flow field information at that location is assigned to a pre-prepared zero-value array. For sampling points inside the hull section, the CSV file does not contain flow field information for these points, and the array defaults to 0, so no additional processing is required.
[0074] After the preprocessing of both parts of data is completed, they are packaged and stored as pkl files using the pickle toolkit.
[0075] First, the model structure is based on a convolutional neural network. The characteristic of this network is that it can effectively extract feature information from images. It is mostly used in the field of image processing. Therefore, in order to build input data for convolutional neural network recognition, its structure needs to take the form of an image - that is, a numerical matrix.
[0076] Secondly, since the present invention aims to obtain the velocity and pressure distribution of the two-dimensional flow field around a fixed obstacle, the output data cannot be a single value or a one-dimensional array, but must be a two-dimensional array that can show the flow characteristics of different regions in the flow field;
[0077] Finally, consider the computational fluid dynamics simulation process: when running a case study, you first need to adjust the grid file, then set the boundary conditions, and finally start the calculation to obtain the flow field solution. In fact, the neural network model performs a similar task to that of computational fluid dynamics software—solving the flow field based on its geometric information and boundary conditions. The input and output data of the two can be converted to each other, but the representation differs. In computational fluid dynamics software, data is identified and stored in the form of case files, while in neural network models, data is identified and stored in the form of numerical matrices.
[0078] like Figure 5 As shown, the convolutional neural network includes: encoder and decoder,
[0079] The encoder consists of the following connected in sequence:
[0080] Input layer, the number of channels is 1, and the image size is 128×128 (the image size is not limited to this, this is just an example);
[0081] The first convolutional layer has 16 channels and an image size of 128×128;
[0082] The second convolutional layer has 16 channels and an image size of 128×128;
[0083] The third convolutional layer has 16 channels and an image size of 128×128;
[0084] In the first pooling layer, the image size is 64×64;
[0085] The fourth convolutional layer has 32 channels and an image size of 64×64.
[0086] The fifth convolutional layer has 32 channels and an image size of 64×64.
[0087] The sixth convolutional layer has 32 channels and an image size of 64×64.
[0088] The second pooling layer has an image size of 32×32;
[0089] The seventh convolutional layer has 64 channels and an image size of 32×32;
[0090] The eighth convolutional layer has 64 channels and an image size of 32×32;
[0091] The ninth convolutional layer has 64 channels and an image size of 32×32.
[0092] The third pooling layer has an image size of 16×16;
[0093] The decoder consists of the following connected in sequence:
[0094] First depooling layer, first deconvolution layer, second deconvolution layer, third deconvolution layer, second depooling layer, fourth deconvolution layer, fifth deconvolution layer, sixth deconvolution layer, third depooling layer, seventh deconvolution layer, eighth deconvolution layer, ninth deconvolution layer, output layer.
[0095] The third convolutional layer and the seventh deconvolutional layer are connected via an additional channel, the sixth convolutional layer and the fourth deconvolutional layer are connected via an additional channel, and the ninth convolutional layer and the first deconvolutional layer are connected via an additional channel.
[0096] The input image is first encoded by an encoder consisting of several convolutional-pooling layers, extracting the feature information contained in the original image. This feature information is then decoded by a decoder consisting of several depooling-deconvolutional layers. Several additional channels for transmitting information are added between specific convolutional and deconvolutional layers in the encoder / decoder. These channels directly copy the image obtained by the convolutional layer and feed it into the subsequent deconvolutional layer to be spliced with the depooled image, doubling the number of channels. This is called a skip connection.
[0097] The advantages of using this network include the following:
[0098] First, because the basic structure of this model is a convolutional neural network, it can inherit the characteristics of convolutional neural networks such as shared weights and sparse connections, which greatly improves its speed in training and prediction compared to traditional fully connected neural networks.
[0099] Secondly, the model adds skip connections to the convolutional neural network. This allows some data to be directly concatenated with the convolutional and pooling data during encoding without undergoing convolution and pooling. This approach reduces data loss caused by convolution and pooling processes, allowing the forecast results to contain more initial information, ultimately improving the forecast effect.
[0100] Finally, since the model adopts an end-to-end training method, it has good applicability in replacing computational fluid dynamics software to deal with problems related to flow field prediction.
[0101] When training the model, the hyperparameters that are optimized include:
[0102] Learning rate: 0.01, 0.001 or 0.0005;
[0103] Convolution kernel size: 3 or 5;
[0104] Channel number distribution: values range from [8, 16, 32] to [8, 16, 32, 64];
[0105] Number of convolutional layers: 2 or 3;
[0106] The basic approach to adjustment is as follows: First, select an initial set of hyperparameter configurations, train the model using those configurations, and use the results (primarily the model's prediction error, or loss function value) to determine where the model is lacking. Then, modify the model hyperparameters accordingly, and evaluate the impact of these modifications on model performance based on the modified training results. This modification process is repeated until the model performance reaches a certain accuracy requirement.
[0107] After optimization, the optimal hyperparameter configuration is finally obtained as follows: learning rate 0.001; convolution kernel size 5; channel number distribution [8, 16, 32, 64]; number of convolution layers 3.
[0108] Compared with the configurations of other models: learning rate 0.001; convolution kernel size 5; channel number distribution [8, 16, 32, 32]; number of convolution layers 2, the prediction error of the model selected by the present invention is smaller and the prediction results are more accurate.
[0109] On an Intel Core i7 8550U processor, a single sample was simulated using the traditional method with a 5-second time step, a 3000-second simulation duration, and eight-core parallel computing. The simulation took 341.4 seconds.
[0110] On the same device, the convolutional neural network model trained by the present invention was used to simulate 300 samples, with a total time of 272.4 seconds and an average time of 0.91 seconds per sample.
[0111] It will be easily understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for rapid prediction of two-dimensional steady laminar flow field based on convolutional neural network, characterized in that: include: The geometric information and boundary conditions of the flow field to be predicted are input into the two-dimensional steady laminar flow field rapid prediction model, and the flow field velocity and pressure distribution are output; The two-dimensional steady laminar flow field rapid prediction model is trained in the following way: Extract the waterplane contours of hulls with different shapes and aspect ratios at different depths from the hull lines to obtain two-dimensional hull profile data; Integrate the two-dimensional hull profile data and fixed flow field boundary conditions to form flow field geometry information and boundary conditions, and solve the flow field velocity and pressure distribution based on the flow field geometry information and boundary conditions; An encoder is composed of multiple convolutional layers and pooling layers, and a decoder is composed of multiple deconvolutional layers and depooling layers. Skip connections are established between some convolutional layers of the encoder and some deconvolutional layers of the decoder to construct a convolutional neural network. The flow field geometry information and boundary conditions are used as input data for the convolutional neural network. The encoder encodes the input data, and the decoder decodes the encoder output data by concatenating the data transmitted by the jump connection with the data obtained by depooling and then performing deconvolution. The hyperparameters of the convolutional neural network are adjusted before each training. When the error between the flow field velocity and pressure distribution output by the convolutional neural network and the solved flow field velocity and pressure distribution is less than the preset value, a two-dimensional steady laminar flow field rapid prediction model is obtained through training. The input data of the convolutional neural network is obtained as follows: Acquire multiple edge point coordinates of the hull section from the two-dimensional hull section data, calculate the distance between each sampling point in the two-dimensional hull section data and each edge coordinate point one by one, take the minimum distance between each sampling point and the edge coordinate point as its signed distance function value, and set the signed distance function value of the sampling point inside the hull section to 0. Thus, the signed distance function values of all sampling points in the two-dimensional hull section data form a signed distance function graph with the central obstacle as the boundary; The coordinates of the upper and lower boundaries of the flow field are obtained from the fixed flow field boundary conditions. The vertical distance from each sampling point in the two-dimensional hull profile data to the upper and lower boundaries of the flow field is calculated one by one. The minimum vertical distance is used as the signed distance function value to form a signed distance function graph with the upper and lower boundaries as the boundaries. Different values are assigned to the inside and outside of the hull section and the upper and lower boundaries of the flow field to form a flow field marker map. The signed distance function graph with the central obstacle as the boundary, the signed distance function graph with the upper and lower boundaries, and the watershed marker graph constitute the flow field geometric information and boundary conditions, which serve as the input data of the convolutional neural network.
2. A method for rapid prediction of two-dimensional steady laminar flow field based on convolutional neural network according to claim 1, characterized in that: The training also includes expanding the input data of the convolutional neural network, including: All hull lines are standardized according to the hull length to keep the length consistent; the hull section is scaled in the length or width direction, so that one direction undergoes a series of changes while the other direction remains unchanged, thereby changing the hull section shape, expanding the two-dimensional hull section data, and then expanding the input data of the convolutional neural network.
3. A method for rapid prediction of two-dimensional steady laminar flow field based on convolutional neural network according to claim 1, characterized in that: The output data of the convolutional neural network includes: a transverse velocity distribution map, a longitudinal velocity distribution map, and a pressure distribution map.
4. A method for rapid prediction of a two-dimensional steady laminar flow field based on a convolutional neural network according to any one of claims 1 to 3, characterized in that: The encoder in the convolutional neural network includes a plurality of convolutional layers, a first pooling layer, a plurality of convolutional layers, a second pooling layer, a plurality of convolutional layers, and a third pooling layer connected in sequence; The decoder includes: a first depooling layer, a plurality of deconvolution layers, a second depooling layer, a plurality of deconvolution layers, a third depooling layer, and a plurality of deconvolution layers connected in sequence; A skip connection is established between the last convolutional layer in the multiple convolutional layers and the first deconvolutional layer in the multiple deconvolutional layers.
5. A method for rapid prediction of two-dimensional steady laminar flow field based on convolutional neural network according to claim 4, characterized in that: A first deconvolution layer of the plurality of deconvolution layers is configured to transmit an additional channel of data.
6. A method for rapid prediction of a two-dimensional steady laminar flow field based on a convolutional neural network according to any one of claims 1 to 3, characterized in that: The hyperparameters include learning rate, convolution kernel size, channel number distribution, and number of convolution layers.
7. A two-dimensional steady laminar flow field rapid prediction system based on convolutional neural network, characterized by: include: A training data construction module is used to extract the waterplane contours of hulls with different shapes and aspect ratios at different depths from the hull lines to obtain two-dimensional hull profile data; Integrate the two-dimensional hull profile data and fixed flow field boundary conditions to form flow field geometry information and boundary conditions, and solve the flow field velocity and pressure distribution based on the flow field geometry information and boundary conditions; A network construction module is used to construct an encoder by combining multiple convolutional layers and pooling layers, and a decoder by combining multiple deconvolutional layers and depooling layers. Skip connections are established between some of the convolutional layers of the encoder and some of the deconvolutional layers of the decoder to build a convolutional neural network. The training module is used to use the flow field geometry information and boundary conditions as the input data of the convolutional neural network. The encoder encodes the input data, and the decoder decodes the data output by the encoder by concatenating the data transmitted by the jump connection with the data obtained by depooling and then deconvolving. The hyperparameters of the convolutional neural network are adjusted before each training. When the error between the flow field velocity and pressure distribution output by the convolutional neural network and the solved flow field velocity and pressure distribution is less than the preset value, the two-dimensional steady laminar flow field rapid prediction model is obtained through training; The prediction module is used to input the geometric information and boundary conditions of the flow field to be predicted into the two-dimensional steady laminar flow field rapid prediction model and output the flow field velocity and pressure distribution; The training data building module includes: An input data acquisition module is used to obtain the coordinates of multiple edge points of the hull section from the two-dimensional hull section data, calculate the distance between each sampling point in the two-dimensional hull section data and each edge coordinate point one by one, take the minimum distance from each sampling point to the edge coordinate point as its signed distance function value, and set the signed distance function value of the sampling point inside the hull section to 0. As a result, the signed distance function values of all sampling points in the two-dimensional hull section data form a signed distance function graph with the central obstacle as the boundary; obtain the coordinates of the upper and lower boundaries of the flow field from the fixed flow field boundary conditions, calculate the vertical distance from each sampling point in the two-dimensional hull section data to the upper and lower boundaries of the flow field one by one, and take the minimum vertical distance as its signed distance function value to form a signed distance function graph with the upper and lower boundaries as the boundaries; assign different values to the inside and outside of the hull section and the upper and lower boundaries of the flow field to form a watershed labeling map, and the signed distance function map with the central obstacle as the boundary, the signed distance function map with the upper and lower boundaries as the boundaries, and the watershed labeling map constitute the flow field geometric information and boundary conditions as the input data of the convolutional neural network; The real data calculation module is used to calculate the flow field geometry information and boundary conditions using fluid mechanics software to obtain the flow field velocity and pressure distribution.
8. A two-dimensional steady laminar flow field rapid prediction system based on convolutional neural network according to claim 7, characterized in that: The input data acquisition module is also used to standardize all hull lines according to the hull length to keep the length consistent; scale the hull section in the length or width direction so that one direction undergoes a series of changes while the other direction remains unchanged, thereby changing the hull section shape, expanding the two-dimensional hull section data, and further expanding the input data of the convolutional neural network.
Citation Information
Patent Citations
Hull profile design method based on convolutional neural network
CN111619755A
Acceleration method and device for flow field prediction
CN114218875A