Disclosure of Invention
The invention provides a hydrofoil design optimization method and a hydrofoil design optimization framework based on deep learning, which utilize GAN to carry out parameterization design on the existing airfoil library, improve the compactness of airfoil representation while maintaining the optimal representation capability, thereby accelerating the convergence rate of the optimal design, establish a hydrofoil performance prediction model based on CNN, graphically represent the hydrofoil contour by utilizing a signed distance function, and provide local geometric information and also contain global geometric information through each point in a hydrofoil image; based on the effective coordination of GAN and the prediction model, a large number of smooth and lifelike hydrofoils can be generated and the performance of the hydrofoils can be rapidly predicted, the hydrofoil design performance in a complex ocean current environment is improved, and the optimized hydrofoils can be applied to the design of three-dimensional horizontal axis tidal turbine blades (HATT) to realize higher performance design.
The invention is realized by adopting the following technical scheme:
the hydrofoil design optimization method based on deep learning is provided, and is characterized by comprising the following steps of:
constructing a hydrofoil generating network model from potential codes to hydrofoil contour mapping by adopting a generating countermeasure network, adding a Bezier layer at the last layer of a generator, and taking control points distributed along a hydrofoil curve as input of the Bezier layer;
constructing a hydrodynamic performance prediction model based on deep learning to realize mapping of hydrofoil contours and hydrodynamic performance parameters; wherein the hydrofoil contour is graphically represented using a signed distance function;
sending the potential codes into a trained hydrofoil generating network to obtain a predicted hydrofoil profile;
graphically inputting the generated hydrofoil profile into a hydrodynamic performance prediction model by adopting a signed distance function to obtain predicted hydrodynamic performance;
and optimizing the hydrofoil profile by taking the maximum lift coefficient and the minimum drag coefficient as optimization targets based on a multi-target optimization method.
In some embodiments of the invention, the hydrofoil generating network model employsMapping of potential codes to hydrofoil contours is completed; wherein (1)>Is the hydrofoil profile generated by the generator, +.>Is a potential code +.>Is a parameter learned by the neural network;
by minimizing empirical loss functionsTo obtain a mapping->:
Wherein->Representing +.>Sum generator->Is indicative of the discriminator +.>The expectation of discrimination probability for the generated samples; />Is a standard generation of a loss function against the network, +.>Is the lower bound of mutual information; />Is predictive condition distribution +.>Is a secondary distribution of (1); />Regularization terms for smoothly optimizing the hydrofoil profile in the training process are respectively used for uniformly distributing control points, aligning edges, closing the profile and avoiding hydrofoil self-intersection; />Is a regularized weight.
In some embodiments of the present invention, the generation of potential codes against network inputs uses a uniform distribution, the noise codes are gaussian, and the calculated error during training updates the training parameters by back propagation:
wherein->A generator and a discriminator; />Is the weight of the neural network, +.>Is biased; />Is the learning rate; />Is the calculation error.
In some embodiments of the invention, the method constructs the hydrodynamic performance prediction model using a depth residual learning framework, comprising: assume that the input isAfter passing through the nonlinear layer, the material is converted into +>The method comprises the steps of carrying out a first treatment on the surface of the Will input +.>Skipping the neural network layer adds directly to the output of the neural network.
In some embodiments of the invention, the method further comprises the step of preparing a hydrodynamic performance prediction dataset based on computational fluid dynamics, comprising: grid generation and computational fluid dynamics simulation are implemented by combining the Python script and the open source code OpenFOAM; and saving the hydrodynamic performance result obtained by simulation as a training data set label.
In some embodiments of the invention, the method further comprises: and reading the hydrofoil curve adjustment grid area through a Python script.
In some embodiments of the invention, the method further comprises: in the generated mesh, a boundary layer is formed by the airfoil curve extending outward.
A hydrofoil design optimization framework based on deep learning is proposed, comprising:
generating a network model by hydrofoil, constructing a generating countermeasure network, adding a Bezier layer on the last layer of the generator, and taking control points distributed along a hydrofoil curve as input of the Bezier layer;
the hydrodynamic performance prediction model is constructed based on deep learning, so that mapping of the hydrofoil profile and the hydrodynamic performance is realized; wherein the hydrofoil contour is graphically represented using a signed distance function;
the multi-objective optimization module adopts a multi-objective optimization method to optimize the hydrofoil profile by taking the maximum lift coefficient and the minimum resistance coefficient as optimization targets;
and the tidal current energy water turbine modeling module based on the optimized hydrofoil uses the uniform chord length and torque angle distribution to perform three-dimensional modeling on the tidal current energy water turbine of the optimized hydrofoil, and adopts STAR CCM+software to simulate the hydrodynamic performance of the tidal current energy water turbine.
Compared with the prior art, the invention has the advantages and positive effects that: according to the hydrofoil design optimization method based on deep learning, the existing airfoil library is subjected to parameterization design by utilizing the generated countermeasure network (GAN), the dimension of the hydrofoil design space is effectively reduced while the optimal representation capability is maintained, the compactness of airfoil representation is improved, and therefore the convergence rate of the optimization design is accelerated; in order to generate smooth distribution of control points, a Bezier layer is added at the last layer of the generator, and the control points distributed along the hydrofoil curve are used as input of the Bezier layer to ensure the continuous characteristic of the hydrofoil; the method comprises the steps of establishing a hydrofoil performance prediction model based on a Convolutional Neural Network (CNN) to realize mapping from a hydrofoil contour to hydrodynamic performance parameters, and graphically representing the shape of the hydrofoil by using a Signed Distance Function (SDF), so that each point in a hydrofoil image matrix not only provides local geometric details of the hydrofoil, but also contains information of a global geometric structure, more information is introduced into a neural network training process, and the training efficiency of the neural network can be improved; the hydrofoil optimization result with higher prediction precision and higher solving speed can be obtained by combining the hydrodynamic performance prediction model with a multi-objective optimization algorithm, and the rapid design of the optimized HATT blade structure is facilitated.
Furthermore, the invention combines the Python script and the open source code OpenFOAM to develop the automatic grid generation and simulation program, the program can automatically complete the CFD simulation of grid generation according to the hydrofoil, and save the simulation result as a training data set label, thereby improving the generation efficiency of the hydrofoil training data set and the accuracy of hydrodynamic prediction performance.
Further, mutual information is added to the empirical loss functions of the generator and the discriminator of the GAN for training the model, and by introducing the mutual information, the generator generates samples more closely related to the input variables (potential codes and noise codes), so that the mutual information between the input variables and the learned features is maximized, more information of the input variables is related to the learned features, and the control performance of the generator is improved.
Furthermore, the hydrodynamic performance prediction model based on CNN obtains high-precision hydrodynamic performance parameters through numerical simulation of hydrofoils, trains a neural network based on a data set, and obtains a high-accuracy prediction model.
Other features and advantages of the present invention will become more apparent from the following detailed description of embodiments of the present invention, which is to be read in connection with the accompanying drawings.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The hydrofoil design optimization method based on deep learning, which is provided by the invention, takes the hydrofoil design of a water turbine as an example, is shown by referring to fig. 1, and comprises five parts, namely, data set construction, hydrofoil generation network model construction, hydrodynamic performance prediction model construction, hydrofoil optimization based on a multi-objective genetic algorithm and water turbine modeling based on optimized hydrofoil.
1. Construction of a data set.
1. The hydrofoil generation dataset is constructed.
The invention selects an UIUC airfoil database provided by the university of illinois as a training data set, wherein the UIUC airfoil database contains approximately 1500 high-quality airfoil design geometric figures, and the geometric figures are represented by discrete coordinates along the upper surface and the lower surface of the airfoil, so that the UIUC airfoil database is widely applied to the research field of airfoil structures of equipment such as unmanned aerial vehicles, jet aircraft wings, turbomachinery and the like.
The invention adopts b spline difference values to unify different numbers of airfoil coordinates into 128 discrete coordinates, the interpolated hydrofoil molded line is shown in figure 2, and the unit represented by c in the figure can define the precision according to the actual design.
2. And constructing a hydrodynamic performance prediction network data set.
Constructing an accurate hydrodynamic performance dataset is critical to developing a deep learning based hydrodynamic predictive proxy model for training the proxy model to achieve a mapping of hydrofoil profile to hydrodynamic performance.
According to the invention, the Python script and the open source code OpenFOAM are combined to automatically complete grid generation and simulation program, the program automatically completes grid generation and CFD simulation according to the hydrofoil, and the simulation result is stored to be used as a data set label, so that the generation efficiency of the hydrofoil data set and the accuracy of hydrodynamic prediction performance can be improved.
The CFD simulation adopts C-shaped grids, compared with complex unstructured grids and self-adaptive grids, the generation process of the C-shaped grids is relatively simple, the C-shaped grids have good stability and convergence in numerical calculation, and the self-adaptive adjustment grid area of the hydrofoil curve is read through a Python script so as to ensure the quality of each grid. And forming a boundary layer (BL, fluid in a region close to the solid surface and a region with a significantly changed speed profile) by extending the airfoil curve outwards so as to improve the accuracy of fluid simulation. In a specific embodiment of the invention, the length of the hydrofoil is set to 1 unit, the airfoil curve extends outwardly to a position of 0.03 units to form a boundary layer, and the first layer height of the mesh is set to 0.0002 units to ensure a high Reynolds numberDada (Chinese character)The value at this time is less than 30, for example, the grid of S809 airfoils is shown in FIG. 3.
After grid generation, the lift and drag coefficients of the hydrofoils are calculated using the Reynolds average Navier-Stokes (RANS) equation, assuming that the airflow around the blades is incompressible, the continuity and conservation of momentum equations for solving the steady-state RANS method are defined as follows:
(1),
(2);
in the method, in the process of the invention,and->(/>=1, 2, 3) is the velocity time average component and the fluctuation component, respectively, +.>For fluid density->For time average pressure>For kinematic viscosity>Is reynolds stress. The invention adopts Shear Stress Transport (SST)>Turbulence model.
The present invention uses the RANS simulation data, but is not limited to the RANS data, and may be LES data or DSN data.
2. And constructing a hydrofoil generating network model.
In the present application, a hydrofoil design generation network based on a generation countermeasure network is constructed for generating new data having the same statistics as training data, as a network illustration shown in fig. 4.
Since the original design of GAN is only suitable for discrete representation, and cannot express the continuous characteristic of the curve important to the shape of the hydrofoil, the invention selects the control points distributed along the hydrofoil curve as the optimization target, adds a Bezier layer on the last layer of the generator, takes the control points distributed along the hydrofoil curve as the input of the Bezier layer to ensure the smooth continuous characteristic of the hydrofoil, and ensures the accuracy and flexibility of curve fitting, wherein the Bezier curve is defined as:
(3);
in the middle ofFor control point +.>Is Bernstein polynomial;>bessel degree; ->Is a coordinate point on the bessel curve.
Bessel layer will control pointsCorresponding weight->And parameter variablesConverted into discrete coordinates of the hydrofoil:
(4);
wherein the number of coordinate points representing the hydrofoil contour is m+1.
In order to directly control the data generated by the input variables (potential code and noise code), the present invention adds mutual information to the empirical loss function of the GAN for training the model so that the generator generates samples that are more closely related to the input variables, thereby improving the control performance of the generator.
In particular, mapping the input variables to a set of features enables the features to better capture underlying data structures and related information, enables a training feature learning model to automatically learn useful feature representations from the input variables, maximizes mutual information between the input variables and the learned features, and ensures that the learned features contain more information about the input variables.
Specifically, the mapping of potential codes to hydrofoil sections accomplished by the combination of generator (G) and discriminator (D) is represented by the following formula:
(5);
wherein,,is the hydrofoil profile generated by the generator; />Is a potential code; />Is a learning parameter of the network.
By minimizing empirical loss functions(objective function of adding mutual information) to obtain a mapping +.>The following is shown:
(6);
wherein the method comprises the steps ofRepresentation pair->And->Representing the desire of the discriminator D to generate a discrimination probability of the sample, by maximizing this value, the generator G will generate a sample similar to the real sample; />Is the loss function of the standard GAN,is the lower bound of mutual information; />Is predictive condition distribution +.>Is a secondary distribution of (1); />Regularization terms for smoothly optimizing the hydrofoil profile in the training process are respectively used for uniformly distributing control points, aligning edges, closing the profile and avoiding hydrofoil self-intersection; />Is a regularized weight.
The potential codes are uniformly distributed, the noise codes are Gaussian distribution, and when the neural network is trained, the calculation errors update training parameters through back propagation, as follows:
(7);
wherein the method comprises the steps ofIs a neural network, such as generator and discriminator; ->Is the weight of the neural network>Is bias; ->Is learning rate;>is the calculation error.
3. And (5) constructing a hydrodynamic performance prediction model.
The invention adopts a hydrodynamic predictive model based on CNN as a proxy model in optimization. The high-precision hydrodynamic performance parameters are obtained through numerical simulation of various hydrofoils, and the neural network is trained based on the data set to obtain the high-precision prediction model, so that time-consuming grid generation and numerical solution are not needed, and the accuracy of hydrodynamic performance prediction is ensured.
The most common representation of hydrofoil geometry is the generation of hydrofoil profile images by means of coordinate points, however, the contour representation is not efficient enough for CNN because it contains blurriness and less geometric information, and in view of this, the present invention uses a Symbolic Distance Function (SDF) to represent the hydrofoil geometry.
Hydrofoil consists of 256256 cartesian network representation, the mesh may effectively work in conjunction with a neural network. The SDF allows nearly every pixel in the grid to provide corresponding hydrofoil information, and more information can improve training.
The value of a point pixel in two dimensions is expressed in terms of its minimum distance from the hydrofoil contour boundary, and the definition of the SDF is as follows:
(8);
wherein,,and->Representing the interior and boundary, respectively, of the hydrofoil profile.Representing the minimum distance to the hydrofoil profile. By way of example, the SDF representation of hydrofoil NACA4418 is shown in FIG. 5. The value of each pixel is normalized and displayed by the colormap. Because the SDF method enables each point in the hydrofoil image matrix to not only provide the local geometric details of the hydrofoil, but also contain the information of the global geometric structure, more information is introduced into the neural network training process, and the training efficiency of the neural network can be improved, so that the SDF method can describe the geometric characteristics of the hydrofoil more effectively than the traditional section method or the binarization method.
As described above, the present invention achieves hydrofoil design optimization through a combination of a hydrofoil generating network and a hydrofoil performance predicting network, so that the accuracy of hydrofoil performance prediction directly affects the performance of hydrofoil design optimization. The object of the present invention is to represent the hydrofoil by SDF and then map the hydrodynamic performance of the hydrofoil using supervised learning. Because of the strong nonlinear mapping relationship between the geometry of the hydrofoil and the hydrodynamic performance, the accuracy of regression is challenged, so that the accuracy of hydrodynamic performance prediction is difficult to ensure for a shallow neural network, generally, increasing the number of neurons helps to improve the convergence of the neural network model, but also increases the risk of overfitting and undergeneralization, and Normalization Initialization (NI) and Batch Normalization (BN) are used in the traditional solution, but the problem of network depth degradation cannot be solved.
In order to alleviate the problem of network degradation caused by increasing the number of network layers, the invention introduces a depth residual learning framework to build a hydrodynamic performance prediction network of the hydrofoil, rather than fitting the desired bottom layer map directly every few stacked layers, explicitly fitting these layers to the residual map. Specifically, assume that the input isAfter passing through the nonlinear layer, the material is converted into +>Let input->Shortcut connection is added to +.>Is output from the (c) device. In the embodiment of the invention shown in fig. 6, the shortcut connections only perform the cross-connection, their outputs +.>Is added to the stack of layers->In the output of (2); the shortcut connection does not introduce any additional parameters or increase the computational complexity. />
4. Hydrofoil optimization based on a multi-objective genetic algorithm.
According to the blade momentum (BEM) theory, the blade elements directly affect the performance of the HATT. Hydrofoils located at a radius are forced by a force as the fluid bypasses the hydrofoil surfaceThe analysis is shown in fig. 7. Wherein->Is the rotation angular velocity of hydrofoil>Is the flow rate. />Andaxial and tangential induction factors, respectively>And->Is the axial velocity and tangential velocity of the hydrofoil>Relative velocity synthesized for axial and tangential velocity>Is the angle of attack->Is the pitch angle of the blade.
The water flow angle of the hydrofoil is calculated as follows:
(9);
lifting force of hydrofoil) And resistance ()>) Torque that affects the rotation of the drive blades and the generation of electricity. Therefore, in order to improve efficiency, the invention adopts a multi-objective optimization algorithm to optimize hydrofoil parameters, and the optimization objective is to maximize the lift-drag ratio +.>。
Coefficient of liftAnd resistance coefficient->The calculation formula of (2) is as follows:
(10),
(11);
in the middle ofIs the chord length of the hydrofoil->Is the incoming flow velocity.
Based on specific attack angle output by hydrodynamic predictive modelAnd->Is to be maximized +.>And minimize->Is optimized for multiple objectives. The optimal hydrodynamic shape can be solved by:
(12);
wherein the method comprises the steps ofFor optimal hydrofoil shape, by the potential code +.>And noise substitutionCode->Controlling. />Is->And the model is obtained from a hydrodynamic performance prediction model.
The invention adopts Genetic Algorithm (GA) to carry out multi-objective optimization. Firstly, randomly generating a population, then simulating the processes of selection, crossing and mutation, eliminating individuals with poor fitness, leaving individuals with strong fitness, and obtaining the optimal individuals in the population through evolution for several generations, wherein the overall flow chart of the algorithm is shown in figure 8.
Based on the hydrofoil design optimization framework based on deep learning, which is built by the invention, a hydrofoil contour is built by utilizing a hydrofoil generation network model, then, a corresponding hydrofoil matrix is generated by an SDF algorithm and integrated into a trained hydrodynamic performance prediction model, so that a large number of smooth and vivid hydrofoils can be obtained, the performances of the hydrofoils can be rapidly predicted, the effective optimization design of the hydrofoils is realized, and the hydrofoils optimized by a multi-objective optimization algorithm can be applied to the design of three-dimensional horizontal axis tidal turbine blades.
In the embodiment of the invention, at the free flow rateAnd attack angle->The hydrofoil generating network uses only three potential codes as design variables, each of which is limited to [ -0.1,1.1 during the optimization process, thanks to the high dimensional generation capability of GAN under fixed conditions]A large number of smooth hydrofoil profiles can be generated and by adjusting the latent codes, changes in hydrofoil geometry, curvature and profile characteristics can be achieved.
The hydrofoil generating network not only remarkably enhances the richness of training data, but also remarkably reduces the dimension of optimization parameters and improves the optimization efficiency. The hydrodynamic performance prediction model based on CNN is used as a proxy model in the optimization process, and the mapping of the hydrofoil contour and the hydrodynamic performance can be directly realized, so that the time-consuming grid generation and numerical solution process is not needed, the accuracy of the hydrodynamic performance prediction is ensured, and the calculation cost of the performance prediction in the optimization process is reduced.
5. Modeling of the turbine based on optimized hydrofoils.
To further verify the utility of the optimized hydrofoils as the hat blade base wings, 6 sets of hydrofoils (OptA-OptF) as shown in FIG. 9 were selected for three-dimensional tidal turbine modeling. Since the goal of this study is to improve the hydrodynamic performance of tidal turbines through design optimization of hydrofoil sections, tidal flow turbines (three-bladed designs) are modeled using uniform chord and twist angles. The following table-shows the potential code distribution of the tidal current energy turbine blade at each section position of chord length and torsion angle, and the final 3D model is shown in fig. 10 (c).
List one
It should be noted that, in the specific implementation process, the above method part may be implemented by a processor in a hardware form executing computer execution instructions in a software form stored in a memory, which is not described herein, and the program corresponding to the executed action may be stored in a computer readable storage medium of the processor in a software form, so that the processor invokes and executes the operations corresponding to the above modules.
The computer readable storage medium above may include volatile memory, such as random access memory; but may also include non-volatile memory such as read-only memory, flash memory, hard disk, or solid state disk; combinations of the above types of memories may also be included.
The processor referred to above may be a general term for a plurality of processing elements. For example, the processor may be a central processing unit, or may be other general purpose processors, digital signal processors, application specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or may be any conventional processor or the like, but may also be a special purpose processor.
It should be noted that the above description is not intended to limit the invention, but rather the invention is not limited to the above examples, and that variations, modifications, additions or substitutions within the spirit and scope of the invention will be within the scope of the invention.