Airfoil optimization for Vertical Axis Hydrokinetic Turbine using genetic algorithm(3)---Evaluation of PARSEC parametrization

1 Evaluation of PARSEC parametrization

The principles that parametrization technique should satisfy are:

  • Minimize the number of degrees of freedom.
  • Be able to represent a wide range of existing airfoils.
  • Parameters should be simple to formulate and impose.
  • The parametrization should result in effective and efficient optimization.

The parametric section(PARSEC) parametrization scheme, which uses the unknown linear combination of base functions to express characteristics of the airfoil, uses 11 different geometrical characteristics of airfoil to solve a system of linear equations. The describing parameters are less enough and sometimes even limit the accuracy and robustness of this method. On the other hand, the physical-based parameters can avoid arbitrary airfoil geometry, which leads to good convergence when combined with genetic algorithm or other optimization methods.
The PARSEC parameters are easy to understand and impose too, so the left question is whether this parametrization scheme can represent a wide range of existing airfoils.

2 Representation of NACA0012 airfoil by PARSEC parametrization

The purpose of Representation is to analyse the residual differences between the approximate and the official airfoil shape. Actually, it's difficult to tell the differences on figures because they are hardly discernible. Thus a quantitative analysis is proposed.

2.1 Fitting analysis

Kulfan[1] suggested that the residual differences between the approximated airfoils and the actual airfoil geometry show be compared with typical wind tunnel model tolerance, which the tighter tolerance for $\frac{x}{c}\leqslant20\%$ is less than the thickness of a piece of printer paper.

$$
z^{error}=|z^{target}-z^{approx}|
\tag{2-1}$$

And the tolerance criterion[2] is:

$$
z^{error}<\left\{
\begin{aligned}
4\times10^{-4}, \frac{x}{c}<0.2 \\
8\times10^{-4}, \frac{x}{c}>0.2
\end{aligned}
\right.
\tag{2-2}$$
The representation process is conducted by using the genetic algorithm, defining the matching residual as the object function. Root-mean-square error(RMSE) is calculated by the following expression:

$$
RMSE_{Z}=\left(\frac{1}{N} \sum_{i=1}^{N}\left(z_{i}^{ \text { target }}-z_{i}^{\text {approx }}\right)^{2}\right)^{1/2}
\tag{2-3}$$

2.2 Genetic algorithm

Genetic algorithms(GA)[3] is a robust and accurate method for global aerodynamic shape optimization and this can be often suggested in the literature. In contrast to gradient optimization approaches, it offers an alternative approach with several attractive features. The basic idea associated with the GA is to search for optimal solutions using an analogy to the theory of evolution.

During solution advance (or "evolution" using GA terminology) each chromosome is ranked according to its fitness vector––one fitness value for each objective. The higher-ranking chromosomes are selected to continue to the next generation while the probability of the selection of lower-ranking chromosomes is less.

In every generation, a new set of artificial creatures (strings) is created using bits and pieces of the fittest of the old;an occasional new part is tried for good measure. While randomized, genetic algorithms are no simple random walk. They efficiently exploit historical information to speculate on new search points with expected improved performance. The newly selected chromosomes in the next generation are manipulated using various operators (combination, crossover, or mutation) to create the final set of chromosomes for the new generation. These chromosomes are then evaluated for fitness and the process continues––iterating from generation to generation––until a suitable level of convergence is obtained or until a specified number of generations has been completed.

GA optimization requires no gradients; it does not need the sensitivity of derivatives. It theoretically works well in non-smooth design spaces containing several or perhaps many local extrema. It is also an attractive method for multi-objective design optimization applications offering the ability to compute the so called "Pareto optimal sets" instead of the limited single design point traditionally provided by other methods. The basic genetic algorithm important steps and the work flow of the GA is depicted in the next figure:

The optimization process uses Dakota software, and here's the relating .in file settings:

method
 soga
  seed = 10525
  max_function_evaluations = 2000
  initialization_type
   unique_random
  crossover_type
   multi_point_parameterized_binary = 2
   crossover_rate = 0.8
  mutation_type
   offset_normal
    mutation_scale = 0.1
  fitness_type
    merit_function
  replacement_type
   elitist
  convergence_type
   best_fitness_tracker
   percent_change = 0.05
   num_generations = 10

2.3 Results

2.3.1 Figures

The iteration history of GA shows the matching residual drops into a very low level after about 20 generation.

The error comparison with typical wind tunnel tolerance represents that only a slight part is beyond the value, which indicates the PARSEC approximate airfoil matches the actual NACA0012 airfoil geometry well.

And the figure below shows that the PARSEC parametrization can represent a large range of airfoils.

The last figure is a comparison between approximate and actual NACA0012 airfoil.

2.3.2 Code

plot iteration history from Dakota output files

from __future__ import division
import os
import re

g = os.walk('.')
files = []
for path, dir_list, file_list in g:
    for file_name in file_list:
        files.append(os.path.join(path,
                                  file_name))
for item in files:
    if re.findall('population_(.*).dat', item) == []:
        continue
    else:
        num = re.findall('population_(.*).dat', item)[0]
        with open('population_' + num + '.dat', 'r') as f:
            lines = f.readlines()
            x = [float(num)] * len(lines)
            y = []
            for line in lines:
                line = line.strip()
                line = line.split('\t')
                y.append(float(line[-1]))
        f = open('population_data.txt', 'a')
        for i in range(1, len(x)):
            f.write(str(x[i - 1]) + '  ' + str(y[i - 1]))
            f.write('\n')
        f.close()

plot a large range of airfoils

import re
import os
import matplotlib.pyplot as plt


def findpath_and_plot(item):
    current = os.getcwd()
    path = re.findall('(.*?)/airfoil_data.txt', item)[0]
    os.chdir(path)
    X, Low, Up = [], [], []
    f = open('airfoil_data.txt', 'r')
    for line in f.readlines():
        value = [float(s) for s in line.split()]
        X.append(value[0])
        Low.append(value[1])
        Up.append(value[2])
    plt.plot(X, Low, X , Up)
    os.chdir(current)


if __name__ == '__main__':
    g = os.walk('.')
    files = []
    for path, dir_list, file_list in g:
        for file_name in file_list:
            files.append(os.path.join(path, file_name))
    for item in files:
        if re.findall('airfoil_data.txt', item) == []:
            continue
        else:
            findpath_and_plot(item)
    plt.show()

3 References


  1. 1.KULFAN B M, BUSSOLETTI J E. 《Fundamental》 Parametric Geometry Representations for Aircraft Component Shapes[J]. 2006: 46. .
  2. 2.KULFAN B M. Universal Parametric Geometry Representation Method[J/OL]. Journal of Aircraft, 2008, 45(1): 142–158[2019–12–09]. https://arc.aiaa.org/doi/10.2514/1.29958. DOI:10.2514/1.29958.
  3. 3.MUKESH R, LINGADURAI K, SELVAKUMAR U. Airfoil Shape Optimization Using Non-Traditional Optimization Technique and Its Validation[J/OL]. Journal of King Saud University - Engineering Sciences, 2014, 26(2): 191–197[2019–12–10]. https://linkinghub.elsevier.com/retrieve/pii/S1018363913000159. DOI:10.1016/j.jksues.2013.04.003.
Author: zcp
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source zcp !
评论
 Previous
fvSchemes学习 fvSchemes学习
1 前言在学习fvSchemes之前,先得把CFD课程过一遍,不然很多格式都不知道是怎么回事。 打开终端,输入: cd $FOAM_TUTORIALS grep -r "Schemes" * -h |sort -n|uniq
Next 
  TOC