You are on page 1of 104

Master Thesis

Aerodynamic Shape Optimization using


Vortex Particle Simulations

Author:

Supervisor:

David Gutierrez Rivera

Prof. Guido Morgenthal


M.Sc. Khaled Ibrahim

A thesis submitted in fulfillment of the requirements


for the degree of Master of Science
in the
Natural Hazards and Risks in Structural Engineering
Faculty of Civil Engineering
Institute of Structural Engineering
Chair of Modelling and Simulation of Structures

Germany, 25.03.2014

WEIMAR
BAUHAUS-UNIVERSITAT
Faculty of Civil Engineering
Institute of Structural Engineering
Chair of Modelling and Simulation of Structures

MASTERARBEIT:

NHRE/2013/12

Name:

David Gutierrez Rivera

Matrikel-Nr.:

101082

Thema:

Aerodynamic Shape Optimization using


Vortex Particle Simulations

Erstpr
ufer:

Prof. Guido Morgenthal

Zweitpr
ufer:

M.Sc. Khaled Ibrahim

Ausgabetermin:

25.10.2013

Abgabetermin:

25.03.2014

Konsultationen:

nach Vereinbarung mit dem Betreuer

Weimar, 25 March 2014

Prof. Guido Morgenthal


Vorsitzender des Pr
ufungsausschusses

Optimization consists on finding the best possible solution to a problem, which usually
means finding the minima or maxima of functions in a feasible region. The need of solving
optimization problems is present in many diverse areas of science and engineering. The
purpose of this Thesis is to pursue Shape Optimization in the area of Wind Engineering.
A Computational Fluid Dynamic (CFD) solver based on the Vortex Particle Method
(VPM) was used for the wind simulation. Automatization of the optimization process
was performed by parameterization of the CFD model, thus generating an optimization
model. In the end, optimization algorithms were used to search for the optimum values
of the model parameters.
For this Masters Thesis, development of the optimization tool is required, focusing on
the following main tasks:

1. Features and Capabilities of the Optimizer:


(a) Pre-Run, Run-Time and Over-Time Optimization Procedures
(b) Multi-Objective Optimization Capability
(c) Parallel Computing Functionality
2. User-friendly interface, including:
(a) Selection of Variables and Objectives
(b) Graphical User Interface (GUI) with Model Geometry Visualization
(c) Support for Multi-Sliced Models
3. Delivery of the Optimization Tool code should:
(a) Adhere to a standard coding style for ease of maintenance
(b) Undergo Testing and Debugging with Benchmarking Examples
(c) Contain User and Technical Documentation
4. Finally, provide a Theoretical Background, with relevant future research ideas and
developments

All results (software code, input files, scripts, results) shall be comprehensively included
in the thesis and its appendices. A softcopy (DVD) shall be included and a summary of
the thesis is to be presented on a poster.

Declaration
I, David Gutierrez Rivera, declare that this thesis titled, Aerodynamic Shape Optimization using Vortex Particle Simulations and the work presented in it are my own.
I confirm that:

This work was done entirely while in candidature for the degree Master of Science
in the Natural Hazards and Risks in Structural Engineering (NHRE).

Where I have consulted or quoted the published work of others, this is always
clearly stated.

I have acknowledged all individuals who have contributed to this work.

I claim no responsiblity for the persistency or accuracy of URLs for external or thirdparty internet websites referred to in this publication, and can not guarantee that any
content on such websites is, or will remain, accurate or appropriate.

Signed:

Date:

WEIMAR
BAUHAUS-UNIVERSITAT

Abstract
Faculty of Civil Engineering
Institute of Structural Engineering
Chair of Modelling and Simulation of Structures
Master of Science
Aerodynamic Shape Optimization using Vortex Particle Simulations

Optimization consists on finding the best possible solution to a problem, which usually
means finding the minima or maxima of functions in a feasible region. The need of solving
optimization problems is present in many diverse areas of science and engineering. The
purpose of this Thesis is to pursue Shape Optimization in the area of Wind Engineering.
A Computational Fluid Dynamic (CFD) solver based on the Vortex Particle Method
(VPM) was used for the wind simulation. Automatization of the optimization process
was performed by parameterization of the CFD model, thus generating an optimization
model. In the end, optimization algorithms were used to search for the optimum values
of the model parameters.

The pessimist complains about the wind; the optimist expects it to change;
the realist adjusts the sails.

William Arthur Ward

Acknowledgments
I want to thank my supervisor Prof. Guido Morgenthal for the opportunity of making
this thesis; his guidance through the process was invaluable. His work with VXFlow is
a core component of this thesis.

I will also like to thank M.Sc. Khaled Ibrahim for his enormous dedication to this
thesis. His knowledge on the area of computer sciences has contributed considerably to
the improvement of this work.

Special thanks go to M.Sc. Benjamin Bendig for his help in building the simulation
models. His work on the VXFlow GPU version of the program has significantly reduced
simulation time. Also his work with VXviz, a VXFlow visualization program, has been
of great help.

Many thanks to Shanmugam Narayanan for his help in debugging the program. His
interest and involvement on the use of the program are greatly appreciated.

To my family . . .

Contents
Proposal

Declaration

iii

Abstract

iv

Acknowledgments

vi

Contents

viii

List of Figures

xi

List of Tables

xii

Acronyms

xiii

1 Introduction
1.1 Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 The Vortex Particle Method . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Optimization Algorithms
2.1 Classification . . . . . . . . . . . . . . .
2.2 Local Optimization . . . . . . . . . . . .
2.2.1 Golden Section Algorithm . . . .
2.2.2 Nelder-Mead Simplex Algorithm
2.3 Gradinet-based Algorithms . . . . . . .
2.4 Global Optimization . . . . . . . . . . .
2.4.1 Genetic Algorithm . . . . . . . .

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

1
2
3
4
5
5
7
8
10
12
13
13

3 Shape Optimization
14
3.1 Black-Box Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 Parametrization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3 Objective Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
viii

ix

Contents
4 VXFlow
4.1 Input File (*.in13)
4.1.1 Geometry .
4.2 Output File (*.o3)
4.3 Other Output Files

.
.
.
.

.
.
.
.

.
.
.
.

5 OptiFlow
5.1 CFD Model . . . . . . .
5.2 Parameter File (*.opt) .
5.3 Objective File (*.m) . .
5.4 Pre-Run Optimization .
5.5 Run-Time Optimization

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

17
17
18
20
20

.
.
.
.
.

22
23
23
25
26
26

6 Optimization Models
Examples
27
6.1 M4 Neath Viaduct Wind Shield . . . . . . . . . . . . . . . . . . . . . . . . 28
6.2 Vertical-Axis Wind Turbine (VAWT) . . . . . . . . . . . . . . . . . . . . . 33
7 Final Remarks
40
7.1 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
7.2 Future Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Bibliography

42

OptiFlow User Guide

45

List of Figures

1.1

Optimization Programmatic View

. . . . . . . . . . . . . . . . . . . . . .

2.1

Local vs Global Minimum . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2

Convex vs non-Convex Function . . . . . . . . . . . . . . . . . . . . . . .

2.3

Golden Section Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.4

Golden Ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.5

Nelder-Mead Simplex Algorithm . . . . . . . . . . . . . . . . . . . . . . . 10

2.6

Types of Simplex Movements . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.1

Black-Box process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3.2

Noisy Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4.1

VXFlow Black-Box process . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.1

Parameter File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

5.2

OptiFlow pre-run procedure . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5.3

OptiFlow run-time procedure . . . . . . . . . . . . . . . . . . . . . . . . . 26

6.1

M4 Neath Viaduct Wind Shield . . . . . . . . . . . . . . . . . . . . . . . . 28

6.2

Wind Shield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

6.3

Wind Shield pre-run Results . . . . . . . . . . . . . . . . . . . . . . . . . . 31

6.4

run-time Wind Shield Results . . . . . . . . . . . . . . . . . . . . . . . . . 31


x

List of Figures

xi

6.5

Wind Shield Height: h = 0.25 . . . . . . . . . . . . . . . . . . . . . . . . . 32

6.6

Savonius Turbine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

6.7

Savonius Static Analysis Results . . . . . . . . . . . . . . . . . . . . . . . 37

6.8

Savonius Pseudo-Dynamic Analysis

6.9

Savonius Dynamic Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 38

. . . . . . . . . . . . . . . . . . . . . 38

6.10 Savonius Rotor: ex = 0.10, ey = 0.10 . . . . . . . . . . . . . . . . . . . . . 39

List of Tables

2.1

Golden Section Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2

Nelder-Mead Simplex Algorithm . . . . . . . . . . . . . . . . . . . . . . . 11

2.3

General Gradient-based Algorithm . . . . . . . . . . . . . . . . . . . . . . 12

4.1

VXFlow Input File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

4.2

VXFlow Geometry Definition . . . . . . . . . . . . . . . . . . . . . . . . . 19

4.4

VXFlow Other Output Files . . . . . . . . . . . . . . . . . . . . . . . . . . 20

4.3

VXFlow Output File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

5.1

VXFLOW Objective Functions . . . . . . . . . . . . . . . . . . . . . . . . 25

6.1

Wind Shield Results Summary . . . . . . . . . . . . . . . . . . . . . . . . 32

6.2

Savonius Results Summary . . . . . . . . . . . . . . . . . . . . . . . . . . 39

xii

Acronyms
GUI

Graphical User Interface

GUIDE

Graphical User Interface Development Environment

CPU

Central Processing Unit

GPU

Graphical Processing Unit

CFD

Computational Fluid Dynamics

VPM

Vortex Particle Method

LO

Local Optimization

GO

Global Optimization

LSM

Line-Search Method

TRM

Trust-Region Method

GA

Genetic Algorithm

BBO

Black-Box Optimization

MDO

Multi-Disciplinary Optimization

xiii

Chapter 1

Introduction
The main goal of this thesis is to achieve Aerodynamic Shape Optimization by the use of
CFD Simulations based on the Vortex Particle Method (VPM). VXFlow [1], a numerical
flow solver developed by Prof. Guido Morgenthal as part of his PhD Dissertation, was
the program chosen for this thesis. In this case the objective function has no analytical
solution and it is solved numerically, this type of objective functions are known as BlackBox Functions. Optimization using such functions is know as Black-Box Optimization
(BBO) or Simulation-based Optimization.
For this purpose OptiFlow [2] was developed, a MATLAB [3] program with a Graphical User Interface (GUI) that interacts with VXFlow, which works as the Black-Box
Function. With OptiFlow a diverse array of operations relevant to Optimization can
be done, such as Data Gathering, Fitting and Surveying, Plotting, Parametrization and
Automatization, Remote Server Access and running of Optimization Algorithms.
The contents of this thesis are organized starting with a small introduction into optimization and the basics of the Vortex Particle Method as the numerical approach used
for wind simulation. Then in Chapter 2 theory surrounding optimization algorithms,
mainly the difference between Local and Global Optimization is explored. In Chapter 3
Shape Optimization and Black-Box Optimization (3.1) are the main topics, and present
the problems involving these kind of optimizations and the appropriate steps to take
in order to solve them. In Chapter 4 concerns VXFlow, which is the CFD program of
choice for the wind simulation and the Black-Box Function. Chapter 5 is about OptiFlow which is the program developed for this Master Thesis, explaining its main features
and how it works. Then in Chapter 6 some optimization examples are presented and
their results. Finally, in Chapter 7 some concluding remarks are made about the outcome of this research and some insights are given on future research ideas and scientific
trends in this area.
1

Chapter 1. Introduction

1.1

Optimization

Generally speaking, optimization consists in the process of finding the best solution to a
given problem, from a given set of available and feasible solutions. Examples of this can
be, finding the lightest superstructure for a bridge, decide which is the most profitable
business plan, or it could be to obtain the best geometrical shape that minimizes windinduced pressure on a vehicle. These problems usually involve minimizing or maximizing
something within the problem, and thats what optimization basically is, to obtain the
best possible solution to a problem.
Mathematically, the optimization problem can be expressed by, [4] [5]

minimize
x

subject to

f (x)
(
gi (x) 0, i = 1, . . . , m

(1.1)

hi (x) = 0, i = 1, . . . , n

where,
f (x) :

Rn R, is the objective function to be minimized

gi (x) 0, are inequality constraints


hi (x) = 0, are equality constraints

This optimization problem statement is formulated for minimization, but the same applies also for maximization problems.
Programmatically, optimization can be viewed as a while loop, [6]

Figure 1.1: Optimization Programmatic View

Chapter 1. Introduction

1.2

The Vortex Particle Method

Vortex Methods are based on the knowledge that in a high-Reynolds number flow there
are three distinct regions: the viscous, rotational boundary layer, the wake and an inviscid outer region which is usually irrotational. They rest on the simplicity of a vorticity
description of the fundamental Navier-Stokes equations for inviscid incompressible flow.
The simulation of such flows is reduced to tracking vorticity-carrying particles in a Lagrangian manner [7].
Vortex Methods have attracted considerable attention in recent years mainly for applications in Bluff Body Aerodynamics. This is due to very good results which can at least
for 2D cases be obtained at a fraction of the computational cost of other numerical
methods, e.g. Finite Volume or Finite Element methods.
The grid-free Vortex Particle Method VXFlow is utilised for this Thesis. It is used to
discretize the Navier-Stokes equations and to evolve the fluid flow in time. The main
features of the code are as follows [1]:
Utilisation of the Boundary Element Method for the enforcement of the no-penetration
boundary condition on solid surfaces.
Surface circulation discretisation by means of elements of linearly varying vorticity.
Smooth Gaussian kernel for mutual vortex interactions.
A fast P3 M algorithm for the computation of the velocity field by Morgen- thal
and Walther based on the utilisation of Fast Fourier Transforms for the solution of
the underlying Poisson equation and a local Particle-Particle correction algorithm.
A partial particle remeshing strategy developed by Morgenthal and Walther
The random walk method for diffusion modelling.

Chapter 1. Introduction

1.3

Software

A list of popular and readily available software used for solving optimization problems
is presented here, along with a small description of each.
MATLAB [3]: is a high-level language and interactive environment for numerical
computation, visualization, and programming.
TOMLAB [8]: is a powerful optimization platform and modeling language for
solving applied optimization problems in MATLAB.
OpenOpt [9]: Free Python-written numerical optimization software suite.
NOMAD [10]: is a C++ software designed to solve problems of Black-box Optimization. The minimal requirement from the user is to provide the objective and
constraints.
CONDOR [11]: Algorithm using parallel, direct and constrained optimization
for high-computing-load objective functions.

Chapter 2

Optimization Algorithms
In this chapter we will make a brief overview on the most commonly known optimization
algorithms. We first talk about the different types of classification we can have for an
optimization problem, and the algorithms that can be used for solving them. We focus
our efforts in the classification of local and global algorithms and discuss some of the
algorithms that exist in these areas in further detail.

2.1

Classification

Optimization problems can be classified by linearity, modality, constraints and objectives, in which cases they can be either linear or nonlinear, uni-modal or multi-modal,
constrained or unconstrained and single or multi-objective optimization, listed respectively. We already noted the importance of understanding each type of optimization, so
we will introduce them briefly here and broaden on the subject on the following chapters.
Linear Optimization (LO), also known as Linear Programming, is an optimization problem were the objective function is a linear function and all of its constraints are either
linear inequalities or linear equalities. Linear Optimization is of little interest to us,
this is because very few problems in engineering can be expressed adequately in such a
limited form; nevertheless it is a great starting point for an introduction to optimization and also to train the ability to intuitively formulate optimization problems of any
kind. On the other hand, Nonlinear Optimization (NLO) deals with either a nonlinear
objective function and/or nonlinear constraints. This will be our main focus of study,
and they are many powerful and elegant iterative algorithms which deal with this kind
of optimization problems.

Chapter 2. Optimization Algorithms

Optimization problems can be constrained or unconstrained, either the objective function or its constraints can bound the domain in which the solution can be found. The
constraints can be systems of inequalities or equalities equations. The amount of objective variables and constraints in the optimization problem can further classify the
problem as small-scale to large-scale optimization; an example of a small-scale optimization would be to find the optimum pier size of bridge and in the other hand a large-scale
optimization could be the optimization of the whole bridge components, piers, cables,
slabs, beams, abutments, etc.
We can also have multiple objective functions on an optimization problem; for example
one can represent the drag force on bridge cross-section and another function can represent the tension force on a cable. Here we might want to minimize both the drag force
and the tension force, thus we have two objectives. In this kind of problem finding a
solution that gives us a minimum for both functions is usually impossible, so we usually
have multiple solutions, for our example it could be a solution with the minimum drag
force, another solution with a minimum tension force on the cable, or we could have
compromise solutions were a compromise is established between the objective functions,
to obtain the most efficient solution.
Modality in an optimization problem refers to the amount of possible local solutions that
can be found for the whole domain. Speaking of minimization, a uni-modal problem
will only have one minimum in the whole domain, thus having only one solution, this
problems are know as Local Optimization (LO). A bi-modal problem will have two local
minimums, and higher order modal problems will have more. The local minimums may
be of interest to us, but it is usually of greater interest to us the global minimum of
the objective function. The subfield that studies such problems is known as Global
Optimization (GO). There are several mathematical algorithms that can solve such
systems but they are usually heuristic in nature, this means that they are methods that
have shown good results with experience but provide no mathematical proof that they
converge to a solution, they are non-deterministic.
For more information check the references [4] [5] [12] [13].

Chapter 2. Optimization Algorithms

2.2

Local Optimization

This branch of optimization is the one dealing on finding the optimum in a defined
region where it is known beforehand that only one optimum exists. This is the branch of
optimization theory that is most developed with well founded theories and mathematical
proofs. It is therefore the one with the fastest algorithms for finding the optimum.

Figure 2.1: Local vs Global Minimum

An important special case of local optimization is the one know as convex optimization
which is the one where all local solutions are global solutions.

Figure 2.2: Convex vs non-Convex Function

[14]

When it comes to Local Optimization Algorithms we can basically have two main categories for finding local minima, gradient-based algorithms and derivative-free (or directsearch) algorithms. Well proceed now to discuss some optimization algorithms, starting with the direct search methods, like the Golden-Section and Simplex (Nelder-Mead)
Methods, which dont require any information about the gradient of the objective function. After that well discuss the gradient dependant methods, like the Gradient Descent
and Newton Algorithms.

Chapter 2. Optimization Algorithms

2.2.1

Golden Section Algorithm

This algorithm divides a given interval in


which the minimum exists in three sections using the golden ratio, this ratio
is applied iteratively effectively narrowing
the interval in which the minimum exists,
until the minimum is found. This algorithm is the limit of the Fibonacci search
for a large number of function evaluations.
Figure 2.3: Golden Section Algorithm

The Golden Ratio is:

a
1+ 5
a+b
= =
= 1.6180339887...
=
a
b
2

Figure 2.4: Golden Ratio

[15]

This is a direct search method, a derivative-free search algorithm. The use of this search
is restricted to unimodal functions, which means that the initial search interval [x0 , x3 ]
must contain the minimum, if this isnt the case the algorithm will converge to a local
minimum in the interval. Also the function must be mono-variate, a function with only
one variable. The main advantage of this algorithm is that function evaluations are
halved, because the interval ratio is kept constant, therefore the previous step function
value is used in the current step.

[3] [13] [16]

Chapter 2. Optimization Algorithms

Algorithm
1. Initialization: Determine interval [x0 , x3 ] which contains the minimum
Calculate intermediate points x1 and x2 using the golden ratio
x1 = a + c

where,

x2 = a c

c=

51
(x3 x0 )
2

Repeat While |x3 x0 | > (a sufficiently small number)


2. Evaluate f (x1 ) and f (x2 )
3. Narrow Search Interval
If f (x1 ) f (x2 )

If

f (x1 ) < f (x2 )

x0 = x0

x0 = x2

x3 = x1

x2 = x1

x1 = x2

x3 = x3

x2 = x3 c

x1 = x0 + c

If |x3 x0 | Stop Iteration.


x3 + x0
2
= f (xmin )

xmin =
fmin

Table 2.1: Golden Section Algorithm

Chapter 2. Optimization Algorithms

2.2.2

10

Nelder-Mead Simplex Algorithm

The idea of using simplexes for optimization was first explored by Dantzig for linear programming. A simplex is a generalization of the notion of a triangle or tetrahedron to arbitrary dimensions. [17] [18]
Here well focus our discussion on the
nonlinear implementation of the simplex
method developed by John Nelder and
Roger Mead in 1965. This algorithm is
a derivative-free method capable of minimizing a multi-variable objective function. [19]

Figure 2.5: Nelder-Mead Simplex Algorithm

[20]
This algorithm requires that an initial guess be provided to start searching for the
minimum, from this an initial simplex is created. The algorithm evaluates the objective
function at each vertices of the simplex and carries out a series of movements, which
include: reflection, expansion, contraction and shrinkage. This movements shift and
modify the original simplex updating and converging it to the minimum on each step.

Figure 2.6: Types of Simplex Movements

[21] [22]

Chapter 2. Optimization Algorithms

11

Algorithm
Algorithm 1: Downhill simplex of (Nelder and Mead, 1965).
input : the cost function f : Rn R
{xi }ni=0 an initial simplex
output: x , a local minimum of the cost function f .
1 begin
2
k0
3
while STOP - CRIT and (k < kmax ) do
4
h arg max f (xi )
i

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

l arg min f (xi )


i

x (1 + )
x xh
where > 0 is the reflection coefficient
if f (x ) < f (xl ) then

x (1 + )x x
where > 1 is the expansion coefficient
if f (x ) < f (xl ) then
xh x
else
xh x

/* expansion */
/* reflection */

else if f (x ) > f (xi ), i 6= h then


if f (x ) f (xh ) then
xh x

/* reflection */

xh + (1 )
x
where 0 < < 1 is the contraction coefficient
if f (x ) > f (xh ) then
l
xi xi +x
i J0, nK
2

else
xh x
else
xh x

/* multiple contraction */
/* contraction */

/* reflexion */

k k+1

return xl

Table 2.2: Nelder-Mead Simplex Algorithm

[13]

Chapter 2. Optimization Algorithms

2.3

12

Gradinet-based Algorithms

When searching for the optimum they are two concepts which all of these methods share
in common. These are Search Direction and Step Size. The way in which these two steps
are carried out inside the algorithm separates this category into to Line Search Methods
and Trust-Region Methods. The main difference between these two methods is that
line search methods first choose a step direction and then a step size while trust-region
methods first choose a step size (the size of the trust region) and then a step direction.
The generic steps taken by this kind of algorithms is:

1. Initialize counter i = 0, and initial guess x0


Repeat While (Convergence Criteria)
2. Calculate Search Direction pi (step 3. for the TRM)
3. Calculate Step Length i , to minimize h(i ) = f (xi + i pi ) (step 2. for the TRM)
4. Set xi = xi + i pi , and i = i + 1
Until Convergence Criteria is Satisfied
Table 2.3: General Gradient-based Algorithm

[5]

The actual methods differ from one another by how the Search Direction pi and the
Step Length i are calculated. The calculation of the Step Length i is know as Line
Search, which usually consists of an inner iterative loop.
The most popular gradient-based optimization algorithms are:
Newton
Quasi-Newton
Gradient Descent
Conjugate Gradient

Chapter 2. Optimization Algorithms

2.4

13

Global Optimization

Several approaches exist for performing Global Optimization, they can be classified in
general terms as [23]:

1. Deterministic Methods
2. Stochastic Methods
(a) Monte Carlo Simulations
3. Heuristic Methods
(a) Evolutionary Algorithms
(b) Swarm-Intelligence
(c) Neural-Networks

2.4.1

Genetic Algorithm

The genetic algorithm solves optimization problems by mimicking the principles of biological evolution, repeatedly modifying a population of individual points using rules
modeled on gene combinations in biological reproduction [3].
Fundamental concepts involved on a Genetic Algorithm are:
Fitness Function
Mutation
Crossover
Selection

Chapter 3

Shape Optimization
Shape Design is vital in the filed of Wind Engineering. We just need to take a look at the
Tacoma Narrows Bridge Collapse [24] to see how important shape design can be. With
the trends on materials engineering, lighter and slender structures are being built and
this structures are usually very sensitive to wind loading, therefore it is very important
for these structures to have aerodynamic shapes.
Shape optimization has been used extensively in the areas of wind energy and aerospace
engineering, in which shape design is critical for the efficiency and correct operation of
the structure.
Shape optimization consists on finding the optimal shape to minimize a certain objective function, also known as cost function, while satisfying given constraints. This is in
contrast to topology optimization, which is concerned with the optimization of components and parts of which the structure is made of, like the number of holes to use in a
component or the floor layout in a building.
Mathematically, a shape optimization problem can be posed as follows, [25]

minimize

subject to

f ()
(
gi () 0, i = 1, . . . , m

(3.1)

hi () = 0, i = 1, . . . , n

where,
is a set of variable parameters that make up the geometry that we want to optimize.
[6]
14

Chapter 3. Shape Optimization

3.1

15

Black-Box Optimization

Black-Box Functions, also know as costly or noisy functions, are functions which evaluation usually involves running some external numerical code that solves systems of
differential equations. The optimization of this kind of functions is known also as expensive optimization, because of the high computational effort required for the evaluation
of these functions. [26]

Figure 3.1: Black-Box process

[27]

Black-Box processes are usually only known from their inputs and outputs, with little or
no knowledge of how it works internally. Black-Box Functions can be originating from
diverse sources, like the running of computer code, solution of system of Partial Differential Equations or even real-life experiments. The optimization involving this type
of functions is usually known as Black-Box Optimization or Simulation-based Optimization. [28]
Another challenge that arises with Simulationbased Optimizations is the noisiness of
our results. Derivate-based optimization
algorithms are ill-suited for this type of
problems, because calculation of derivatives most of the time is not possible.
Some derivative-free methods are robust
for small perturbations on the objective
function, but with high noise levels these
methods also fail and get trap in between
these perturbations before finding the op-

Figure 3.2: Noisy Functions

timum. [6]
Stochastic Optimization is the field which addresses this problem. Some research is going
into this field by adapting currently known methods into handling stochastic behavior
on the objective function. Please check references [29] and [11] for some examples of
research in this field.

Chapter 3. Shape Optimization

3.2

16

Parametrization

This is a fundamental step in performing Shape Optimization. It consists on the definition of variables in the geometric model that we wish to optimize. Traditionally in
the analysis process, all dimensions of a structure are kept constant in the geometrical
numerical model. Now in order for us to perform simulation-based optimization we need
to have parametrized dimensions, so instead of taking a constant value they now can
be modified by the optimization routine, attaching it to the optimization process and
making it converge to the optimum shape.
Please refer to Section 5.2 to see how parametrization is implemented in OptiFlow.

3.3

Objective Functions

With the Objectives Functions is how the optimization problem is established. This
functions perform 3 basics task:
Replace variables values
Evaluate
Read
First the parametrized values are replace with the values issued by the user or the
optimization algorithm. Then calculations are done, the function is being evaluated. En
finally the result (output) from the evaluation is read.
It is in the objective function that it is defined against what it is desired to optimized
a certain optimization problem, and it is the segment of the optimization process which
controls the flow of the algorithm.
Please refer to Section 5.3 to see how objective functions are implemented in OptiFlow.

Chapter 4

VXFlow
VXFlow is a flow solver based on the Vortex Particle Method. It allows very efficient simulation of two-dimensional flows around bodies of arbitrarily complex geometry and arrangements of such. Main areas of application is in Wind Engineering of
structures, Aerodynamics, Aerospace Engineering and Offshore Engineering. Coupled
fluid-structure interaction analysis is possible, enabling simulation of vortex-induced
vibrations (VIV), flutter or galloping. [1]
In this Chapter we will discuss our Black-Box Simulation Program VXFlow. Our purpose
here is to explain the basics on the usage of the program, mainly the inputs and outputs
of the program. We will only discuss subjects that are relevant to the usage OptiFlow.
For detailed explanation on the usage of the program please refer to VXFlow Primer [1]
and for more information on the numerical method used on the program please refer to
the Ph.D. Thesis by Morgenthal [7].

Figure 4.1: VXFlow Black-Box process

4.1

Input File (*.in13)

The VXFlow input file is the definition of the CFD model, and consists of a list of parameters which the program reads to build the model. In Table 4.1 we list the most basic
parameters and the most important when it comes to optimization, with commentary
on how they are used in the optimization.
17

Chapter 4. VXFlow

18

Item (default)

OptiFlow

NSLICES (none)

Nothing

Description
Number of Slices of the Structure. This affects the number of columns for the output file, because forces and displacements are
dumped into it for each slice and each section
of a slice.

NSTEPS (10000)

Nothing

Number of timesteps to be performed; if


NSTEPS=0 then calculation is performed
until user interruption. In the case of optimization it is important to have a value
that provides accurate results in a reasonable
amount of time.

NUMSEC (1)

Read

Number of individual cross sections (separate


bodies). This also affects the output of the
output file (*.o3), and it is read by OptiFlow
to know how many sections are in a slice and
be able to read the user desired parameter
from a specific section or a slice.

GEOMROT (0.0)

Read/Modify

This is read by OptiFlow to plot the correct rotation of the geometry, and it can also
be modified by an objective function on each
simulation.

Table 4.1: VXFlow Input File

4.1.1

Geometry

The last values in the input file are the polygonal x-y coordinates of each section for each
slice of the model. The first point given is the leading edge (corner) and the number of
panels given is inserted on the edge running from this point to the one in the next line.
The last line contains the point on the circumference and panel information for the edge
which closes the section.

3.2. INPUT PARAMETERS

Chapter
4. VXFlow
Input
parame-

19

Description

ter (default)
num.cornerpoints
EachHere
rowfollow
has the
following format:lines with the following format, providing information
on how to discretise the surface of the section, running in an anti-clockwise manner
around
the
section.
The rst point given is the leading edge (corner) and the
ID CX
CY N
MX
MY
number of panels given is inserted on the edge running from this point to the one
in the next of
line.
last line
contains
the point
on the
An explanation
eachThe
of these
values
is provided
in Table
4.2. circumference and panel
information for the edge which closes the section. Rows look like:
ID CX CY N MX MY
ID
Edge shape identier: (1)=linear edge; (2/3)=arc edge
CX
X-coodinate of corner point
CY
Y-coodinate of corner point
N
Number of panels to be created on this edge
MX
X-coordinate of the centre of the circle part of which this edge
is. MX and MY are only provided for arc edges, i.e. ID=2 or
3. The edge is constructed through the rst point and around
the center given, where ID=2 provides a forward and ID=3
a backward pointing arc. The user has to ensure that this
arc actually goes through the second point (geometrically the
problem is overdetermined).
MY
Y-coordinate of centre, cf. also MX
example:
p 1x , p 1y
N4
p 4x , p 4y
N1

M x3 ,M y3

N3

p2x , p 2y
N2

p3x , p 3y

would be achieved by the following sequence:


1 p1x p1y N1
1 p2x p2y N2
2 p3x p3y N3 Mx3 My3
1 p4x p4y N4
Table 3.11: Input parameters for the VXow code (X)
Table 4.2: VXFlow Geometry Definition

19

[1]

Chapter 4. VXFlow

4.2

20

Output File (*.o3)

The VXFlow output file is a tab-delimited file which collects the values of section and
slices forces and displacements on each simulation time-step. Each column refers to
a different parameter and each row is the value of these parameters for the time-step
evaluated in the simulation. The general formatting of this file is shown on Table 4.3.

4.3

Other Output Files

VXFlow also outputs other files if the flags for these are switched on. A list of these file
types, their flags and description is shown in Table 4.4

Flag (default)

File Extension

Description

VXFL (0)

*.vx2

Vortex velocity output

SKFL (0)

*.sk2

Plotting of streaklines on screen

FVFL (0)

*.fv2

Absolute velocities on the isoline grid

PRFL (0)

*.pr1

Surface pressure output

RSTFL (0)

*.rst

Restart File

VIZFL (0)

*.mvxb

Graphics output flags for VXviz

Table 4.4: VXFlow Other Output Files

In the case of running an optimization problem it is suggested that these flags are
switched off, as it is by default. They are not needed for calculations and are only used
for post-processing and flow visualization by programs like VXPost and VXviz.

tN ST EP S

t1
..
.

Time

DRAG
..
.
DRAG

F orces(j)
LIFT MOMENT
..
..
.
.
LIFT MOMENT
H.DISPL
..
.
H.DISPL

Sect.(i)(j)
R.DISPL
..
.
R.DISPL

Sect.(i)(j + 1)

...
Sect.(i)(NUMSEC)
...
...
..
.
...

Table 4.3: VXFlow Output File

Displ.(j)
V.DISPL
..
.
V.DISPL

Slice(i)

Slice(i + 1)
Sect.(i + 1)(j)

...
Slice(N SLICES)
...
...
...
...
..
.
...

Chapter 4. VXFlow
21

Chapter 5

OptiFlow
OptiFlow is the Optimization Tool developed for this Thesis. It is written in MATLAB and has a user-friendly GUI Environment. MATLAB built-in functions are used
for File Manipulation, Data-Fitting and Optimization.
An optimization model is required to be built before the use of OptiFlow. This optimization model consists of three main components:
CFD Model *.in13 File
Parametrization *.opt File
Objective Function *.m File
A Computational Fluid Dynamics (CFD) Model is required by OptiFlow to be used for
the optimization. This model needs to be parametrized in order for it to be used in the
optimization process. This is done with the Parameter file an *.opt file. The Objective
Functions control the flow of the optimization by establishing the objectives desired to
achieve.
The following sections discuss each of this components further.

22

Chapter 5. OptiFlow

5.1

23

CFD Model

The CFD model consists on the numerical setup for the wind simulation, in our case
it is defined in the *.in13 file, which is VXFlow input file. This model should be well
defined and working correctly, as this will be the base for generating the Optimization
Model.
Currently OptiFlow supports VXFlow as the simulation program. For more information
on how to create a CFD Model refer to the VXFlow Primer.

5.2

Parameter File (*.opt)

Parametrization of the Optimization Model is performed in the *.opt File. We use M4


macro Language to define and parametrize the optimization variables.
M4 is a macro language, usually available in Unix platforms, which can be used as a
text-replacement tool. For example, if M4 receives as input:

# This is a comment
define(Value, 1.00)
Variable
x = Value

then it will output:

Variable
x = 1.00

Basically we use this ability to define our optimization variables and replace their values
with the ones obtained from the optimization algorithm.

M4-scripting is also capable of basic arithmetics, but a definition of a function (calc in


our case) is required. We assign Perls Math and Trig functions to this, and we do this
with the following code:

define(calc, [esyscmd(perl e 'use Math::Trig; printf (\$1)')])

Chapter 5. OptiFlow

24

For example if we have:

define(a,4)

# Triangle base

define(b,3)

# Triangle height

define(c, calc( sqrt( a**2 + b**2 ))


# 'a**b' stands for 'ab' ('a' to the power of 'b')
The hypotenuse is: c

then we would get:

The hypotenuse is: 5

Take note that it is very important to define unique variables names in the M4 script,
so that they do not conflict with the rest of the text in the file.

Finally, to build our M4-script File and generate our desired output file we type in the
terminal:

m4 vxf model.m4 > vxf model.in13

For more information about M4-Programming check references [30] [31].


Now lets talk about our *.opt Model File. Generally speaking, this file will consist of two
main parts, the M4-Script Definition and the CFD Model, this is illustrated on Fig. 5.1.

Figure 5.1: Parameter File

Chapter 5. OptiFlow

25

You can generate this M4-Files manually, but you can also use OptiFlows GUI to help
you in this task. Follow the sequence Build Parameter File (*.opt) from the
Menu Bar, to get a template to write your own Parameter File. With this utility you
can open a text-based file and a *.opt Template File will be auto-generated from this
file, taking it as if it were the CFD Model. This template has some basics definitions
and commands commonly used in optimization problems.
The parameter file contains the information about the variables to be used in the optimization and the parametrization of the file. All variables are enclosed between the
[begin{variables}] and [end{variables}], and are defined inside the define( ) command. An example is shown below:

# Variables Definitions:
[begin{variables}]
define(x1, @)

# Comment 1

define(x2, @)

# Comment 2

#... others ...#


[end{variables}]

To build the Parameter File you can use Build Parameter File (*.opt) from the
Menu.

5.3

Objective File (*.m)

This is a MATLAB function file which works as the objective function of the optimization. In this file you must call Objective Functions that will call the Program to run
and evaluate the values you require. The available functions for VXFLOW are shown
on Table 5.1.

Function

Description

VXF FORCES

Used to obtain Forces from the Simulation.

VXF DISPL

Used to obtain Displacement from the Simulation.

VXF DERIV

Used to obtain Derivatives from the Simulation.

VXF GEO

Used to obtain Geometrical Values from the Model.


Table 5.1: VXFLOW Objective Functions

To build the Objective Function File you can use Build Objective File (*.m)
from the Menu.

Chapter 5. OptiFlow

5.4

26

Pre-Run Optimization

This optimization procedure requires a Data File. From this data a fit function is
obtained by using data fit methods provided in the program.

Figure 5.2: OptiFlow pre-run procedure

5.5

Run-Time Optimization

In this Optimization procedure you only need to set-up the Optimization Model, optimization is made on-the-fly.

Figure 5.3: OptiFlow run-time procedure

Chapter 6

Optimization Models
Examples
The purpose of this chapter is to show some optimization examples using the program
OptiFlow. Two optimization examples are presented, a Wind Shield for vehicular protection of the M4 Neath Viaduct and a Vertical-Axis Wind Turbine (VAWT) based on
the savonius rotor.
An overview of each example is given and the motivation for optimizing them.

27

M4 Neath Viaduct
Wind Shield
6.1

M4 Neath Viaduct Wind Shield

This bridge is located in South Wales and crosses the River Neath [7]. A section of the
bridge is very exposed in flat topography, therefore a wind shielding system is desired
for reducing the overturning forces on vehicles. The CFD model used herein is the same
as the one used on the VXFlow tutorial example.
We placed four small sections in the freeway just to obtain the interior drag forces in
this region, as shown in the Figure 6.1.

Figure 6.1: M4 Neath Viaduct Wind Shield

The optimization problem is to find the optimum vertical positioning of the Wind Shield
in order to reduced overturning forces in the freeway. We define the optimization variable
as h, which is the height of the Wind Shield. The other parameters of the simulation
are also shown in Figure 6.2.
28

Chapter 6. M4 Neath Viaduct Wind Shield

29

Figure 6.2: Wind Shield

Parameters
The parameter h is defined in the *.opt file, all coordinates of the Wind Shield are made
dependent of this parameter, this is known as parametrization. This is shown in the
code below:

# Variables Definitions:
[begin{variables}]
define(h, @) # Height of Wind Screen
[end{variables}]
define(L, 3.00) # Wind Screen Length
define(t, 0.15) # Wind Screen Width
# Wind Screen Coordinates
define(x1, calc(013.00))
define(x2, calc(x1t))
define(y1, calc(h0.25))
define(y2, calc(y1+L))

Chapter 6. M4 Neath Viaduct Wind Shield

30

Then in the CFD model part of the Parameter File we place the corresponding coordinates variables. These will bee replaced when the m4-macro is called on each iteration
of the optimization algorithm.

4 //num cornerpoints**SCREEN3(SCHEME3)
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 x2 y1 n1
1 x1 y1 n2
1 x1 y2 n1
1 x2 y2 n2

Objectives
For this optimization problem our objective is to minimize the drag force for vehicle
passing by, therefore we placed four small sections on the freeway just to obtain the
drag force on this points. Our Objective is to Minimize the Maximum of these Drags.
The Objective Function File is shown below:

function [Drag] = M4 Neath ViaductWS(X)


%%

M4 Neath ViaductWS Objective Function

steps = 500;
Drag(1) = VXF FORCES(X,'DRAG','MAX',steps,'SECTION',11);
Drag(2) = VXF FORCES(X,'DRAG','MAX',steps,'eval',false,'SECTION',12);
Drag(3) = VXF FORCES(X,'DRAG','MAX',steps,'eval',false,'SECTION',13);
Drag(4) = VXF FORCES(X,'DRAG','MAX',steps,'eval',false,'SECTION',14);
[Drag,Lane] = max(Drag(:))
% Call optiOUT to generate Plots and Output Data
optiOUT(X, [Drag]);
end

Results
In the pre-run optimization procedure we collected data from 0 to 1.5 at steps of 0.1 for
the value of h. The collected points and the smoothing data fit is shown on Figure 6.3

Chapter 6. M4 Neath Viaduct Wind Shield

31

Figure 6.3: Wind Shield pre-run Results

The optimum is then obtained to be h = 0.2 with a drag = 87.43. It is worth mentioning
that this value is from the 3rd lane from left to right.
For the run-time procedure we use the Golden Section algorithm. It run for 8 iterations
and found the optimum to be at h = 0.23607 with a drag = 61.109. It is important to
note that the Golden Section is not a Global optimization and therefore is not reliable
for a noisy function, but in our case we notice from the data gathering that between h
values of 0 and 1 the function mostly has one unique optimum, and therefore we use
this algorithm in this range. The results are shown on Figure 6.4

Figure 6.4: run-time Wind Shield Results

Chapter 6. M4 Neath Viaduct Wind Shield

32

A summary of the optimization results obtained from each run type is shown on Table 6.1
Run Type

Drag

pre-run

0.2

87.43

run-time

0.23607

61.109

Table 6.1: Wind Shield Results Summary

The Final Shape of the Optimized Wind Shield is shown on Figure 6.5

Figure 6.5: Wind Shield Height: h = 0.25

Vertical-Axis Wind Turbine


(VAWT)
6.2

Vertical-Axis Wind Turbine (VAWT)

The Savonius Wind Turbine [32] is a Vertical-Axis Wind Turbine (VAWT) which main
advantages are its reliability and practicality. The optimization problem is to find the
optimum values for the eccentricity variables (ex and ey ) in order to maximize Moment
or Power depending on the model type. The parameters of the wind turbine have been
taken from the dimensions of an empty oil drum, and are summarized on Figure 6.6

Figure 6.6: Savonius Turbine

The variables are bounded to the shaded area shown on Figure 6.6, which are:
ex = [0 0.5]
ey = [0 0.5]
33

Chapter 6. Vertical-Axis Wind Turbine (VAWT)

34

For the solution of this problem three types of optimization models were prepared, they
are:
Static Model
pseudo-Static Model
Dynamic Model
Each of this models differ from one another in the way they obtain the desired objective,
this will be discussed on the Objectives Section.

Parameters
Again the parameters are defined in the *.opt file, between the brackets [begin{variables}]
and [end{variables}]. This time we have two variables and all coordinates of the Turbine need to be parametrized to them. This is done with code shown below:

# Variables Definitions:
[begin{variables}]
define(ex, calc(0.1+Imper)) # Eccentricity in XDir
define(ey, calc(0.1+Imper)) # Eccentricity in YDir
[end{variables}]
# Rotor Dimensions:
define(D1, 0.572) # Rotor Inside Diameter
define(D2, 0.584) # Rotor Outside Diameter
define(t, calc(D2D1)) # Rotor Thickness
# Coord. Calculations:
# Section 1
define(x1, calc((ex/2)))
define(y11, calc(D1(ey/2)))
define(y12, calc(y11D1))
define(y13, calc(y12t))
define(y14, calc(y11+t))
define(xc1, calc((ex/2)))
define(yc1, calc(y11D1/2))
# Section 2
define(x2, calc(ex/2))
define(y21, calc(D1+(ey/2)))
define(y22, calc(y21+D1))
define(y23, calc(y22+t))
define(y24, calc(y21t))
define(xc2, calc(ex/2))
define(yc2, calc(y21+D1/2))

Chapter 6. Vertical-Axis Wind Turbine (VAWT)

35

The coordinates parametrization of the Savonius Rotor is shown in the code below:
4 //num cornerpoints
0.2 0.0 //release distance*spacing hull
0.0 0.002 0.0 0.02 //merg1*merg2*merg3*merg4
4 4 1 3 1 //section color coding:drag*lift*moment*displ*rotation
3 x1 y11 nd1 xc1 yc1
1 x1 y12 nt
2 x1 y13 nd2 xc1 yc1
1 x1 y14 nt
4 //num cornerpoints
0.2 0.0 //release distance*spacing hull
0.0 0.002 0.0 0.02 //merg1*merg2*merg3*merg4

4 4 1 3 1 //section color coding:drag*lift*moment*displ*rotation


3 x2 y21 nd1 xc2 yc2
1 x2 y22 nt
2 x2 y23 nd2 xc2 yc2
1 x2 y24 nt

The Dynamic Model requires additional parameters to be set on the CFD model, these
are:
DYNAMIC=1
STRCMODEL=1
DAMPRATIO=1.0
RAYLA0=0.0
RAYLA1=0.0
ASEC0=5E3
ASEC1=5E3
MASS11=0.0
MASS12=0.0
MASS21=0.0
MASS22=1.0
STIFF11=9E9
STIFF12=0.0
STIFF21=0.0
STIFF22=0.0

Objectives
The Objective Function for the static model is the following:
function [Mo] = rotor static(X)
%% rotor static Objective Function

Chapter 6. Vertical-Axis Wind Turbine (VAWT)

36

Mo = VXF FORCES(X,'MOMENT');
% Call optiOUT to generate Plots and Output Data
optiOUT(X, [Mo]);
end

The Pseudo-Dynamic Model consists on rotating the Geometry around 360at steps of
45and averaging the values of the Moment. The Objective File for the Pseudo-Dynamic
case is the following:

function [AvgMo] = rotor pseudo static(X)


%% rotor pseudo static Objective Function
[DMdr, AvgMo] = VXF DERIV(X,'MOMENT','GEOMROT',[180 45 180])
AvgMo = mean(AvgMo); DMdr = mean(DMdr);
% Call optiOUT to generate Plots and Output Data
optiOUT(X, [AvgMo]);
end

The Dynamic Model is the most accurate model and has the following objective function:

function [Power] = rotor dyna(X)


%% rotor dyna Objective Function
Variables = getappdata(0,'Variables'); % Variables Data
modelPATH = getappdata(0,'modelPATH'); % Model Path
% Savonious Rotor Data
D = 0.578;

% Rotor Avg Diameter [m]

m = 10;

% Mass [kg]

% Calculate Arm vector


Arm = [X(1)/2, X(2)/2] + [(4/6)*D/pi, D/2];
Arm = norm(Arm);

% Calculate Inertial Mass


Mass = 2*m*Arm2;
m4Mod('MASS22',Mass,fullfile(modelPATH, Variables.FILE));
% Angular Velocity
Omega = VXF DERIV(X,'RDISPL','TIME',50,'SECTION',1);
Omega = mean(Omega);
% Torsional Force
Torque = VXF FORCES(X,'MOMENT','MEAN',50,'eval',false);
Power = Torque * Omega;

Chapter 6. Vertical-Axis Wind Turbine (VAWT)

37

% Call optiOUT to generate Plots and Output Data


optiOUT(X, [Power]);
end

Results
Static Analysis
Data collected from a static model were smoothed by using cubic interpolation to get
the surface shown below:

Figure 6.7: Savonius Static Analysis Results

These results were unsatisfactory, this goes to show that inappropriate modeling of the
problem in study will lead to erroneous results. But it does show 2 potential areas for
the optimum values to exist, which are for ex = 0.1 and ey = 0.3.

Pseudo-Dynamic Analysis
This approach yielded better results than the previous one. Again as in the previous
analysis, data was collected from the model and was smoothed using cubic interpolation
to get the surface shown below:

Chapter 6. Vertical-Axis Wind Turbine (VAWT)

38

Figure 6.8: Savonius Pseudo-Dynamic Analysis

With this, we decide to adopt the values for the eccentricities as ex = 0.075 and ey = 0.10,
for the optimum values.

Dynamic Analysis
From the data collected cubic interpolation was performed and we obtained the surface
shown below:

Figure 6.9: Savonius Dynamic Analysis

This analysis gave us faster and more conclusive results, because it approaches closer to
reality.

Chapter 6. Vertical-Axis Wind Turbine (VAWT)

39

We summarize the optimization results obtained from each model type on Table 6.2

Model Type

ex

ey

Mo

Static

0.1

0.3

12.33

Pseudo-Dynamic

0.075

0.1

4.524

Dynamic

0.15

0.1

22.93

Table 6.2: Savonius Results Summary

The Final Shape of the Optimized Savonius Turbine is shown on Figure 6.10

Figure 6.10: Savonius Rotor: ex = 0.10, ey = 0.10

Chapter 7

Final Remarks
7.1

Conclusions

The relatively low computational costs and the highly accurate simulations of the Vortex
Particle Method used in this Thesis are great reasons for using this CFD program for
simulation-based optimization. In addition it is a mesh-free numerical method, which
allows for easier and faster parametrization of the models, in contrast to meshing methods whose geometry is defined within its discretization, which needs to be changed and
checked at each simulation.
However, it is very important to address the issue of noisiness produced from the
simulation-based optimization. It is important to address this issue in an efficient manner. Some recommendation are:
Tweak Local Optimization Algorithms: A stochastic analysis of the simulation program is recommended, as well as using this data for tweaking current
optimization algorithms for robust and efficient convergence behavior. The NelderMead Simplex method is a convenient gradient-free algorithm for this purpose.
Run-Time Smoothing: This involves smoothing the noisy objective function by
implementation of a smoothing routine at run-time of the algorithm.
Global Optimization Algorithms: Add more Global Optimization Algorithms.
Refer to 2.4 for more information.
Parallelization: Many Global Optimization Algorithms take advantage of Parallel Computing. The speed-up of the optimization process would multiply with
the amount of CPUs used for the task.
40

Chapter 7. Final Remarks

41

For making the optimization process more user-friendly, it would be desirable to have a
GUI interface for the definition of the parameters, by directly clicking in the geometry.

7.2

Future Research

A very exciting area of research in the field of Optimization is the one known as MultiDisciplinary Optimization (MDO). This area has been most explored in the field of
aerospace engineering, not as much in civil engineering. With so many fields involved on
the design of a structure, like Earthquake, Wind, Hydraulic and Structural Engineering,
it is both challenging and rewarding to optimize important structures by including and
interacting with each of these elements.
Life-Cycle design is another interesting area of study. By including the effects of all
Natural Hazards into a simulation it is possible to design for a target Life-Time, resulting
in more reliable and economical structures.
The study and development of Optimization Algorithms is a current trend in the area
of Mathematics. Exploiting current trends in computer hardware, like Parallelization
and Graphical Processing Units (GPU) is encouraged. Other approaches are in the
purely mathematical, stochastic, and/or geometrical theories, as opposed to a heuristic
approach.

Bibliography
[1] Guido Morgenthal. VXFlow v0.994. Weimar, Germany, September 2011. VXFlow
Primer. http://www.morgenthal.org/vxflow.
[2] David Gutierrez Rivera. OptiFlow v0.6.1a. Weimar, Germany, March 2014. OptiFlow Userguide.
[3] The MathWorks Inc. MATLAB v7.10.0 (R2010a). Natick, Massachusetts, 2010.
User Documentation, GUIDE, Curve Fitting Toolbox, Optimization Toolbox,
Global Optimization Toolbox, Parallel Computing Toolbox. http://www.matlab.
com/.
[4] Stephen Boyd and Lieven Vandenberghe. Convex Optimization. Cambridge University Press, The Edinburgh Building, Cambridge, CB2 8RU, UK, 2004. Pages:
1-11, 455-496. http://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf.
[5] Jorge Nocedal and Stephen J. Wright. Numerical Optimization. Springer, 175 Fifth
Avenue, New York, NY 10010, USA, 1999. Pages: 2-3, 4-7, 10-30.
[6] Igor Griva, Stephen G. Nash, and Ariela Sofer. Linear and Nonlinear Optimization. Siam, 3600 Market Street, 6th Floor, Philadelphia, PA 19104-2688 USA, 2nd
edition, 2009. Pages: 35-40, 54-58, 355-450.
[7] Guido Morgenthal. Aerodynamic Analysis of Structures Using High-resolution Vortex Particle Methods. University of Cambridge, Ph.D. Thesis, October 2002. Pages:
21-31, 121-142.
[8] Tomlab Optimization. TOMLAB, 2013. http://tomopt.com/tomlab/.
[9] OpenOpt. OpenOpt. National Academy of Sciences of Ukraine, 2013. http://
openopt.org/Welcome.
[10] M.A. Abramson, C. Audet, G. Couture, J.E. Dennis, Jr., S. Le Digabel, and
C. Tribes. The NOMAD project, March 2013. http://www.gerad.ca/nomad.

42

43

Bibliography
[11] Frank Vanden Berghen.

Constrained, non-linear, derivative-free,parallel op-

timization of continuous,

high computing load,

Universite Libre de Bruxelles, Ph.D. Thesis, 2004.

noisy objective functions.


http://theses.ulb.ac.

be/ETD-db/collection/available/ULBetd-04142004-190105/unrestricted/
thesis_optimization_frank.pdf,

http://www.applied-mathematics.net/

CONDORManual/CONDORManual_1.0.pdf.
[12] David G. Luenberger and Yinyu Ye. Linear and Nonlinear Programming. Springer,
233 Spring Street, New York,NY 10013, USA, 3rd edition, 2008. Pages: 2-7, 183257.
[13] Florent Brunet. Contributions to Parametric Image Registration and 3D Surface
Reconstruction. Universite dAuvergne, Ph.D. Thesis, November 2010. Chapter 2,
Pages: 27-44. http://www.brnt.eu/publications/brunet2010phd.pdf.
[14] Valentin Haenel, Emmanuelle Gouillart, and Gael Varoquaux.
entific lecture notes.
ter 13,

Pages:

Python Sci-

EuroScipy tutorial team, November 2013.

Chap-

251-265. http://scipy-lectures.github.io/_downloads/

PythonScientific-simple.pdf.
[15] Wikipedia.

Golden ratio.

The Wikimedia Foundation, 2014.

http://en.

wikipedia.org/wiki/Golden_ratio.
[16] Wikipedia. Golden section search. The Wikimedia Foundation, 2014. http://en.
wikipedia.org/wiki/Golden_section_search.
[17] Wikipedia. Simplex. The Wikimedia Foundation, 2014. http://en.wikipedia.
org/wiki/Simplex.
[18] Wikipedia. Simplex algorithm. The Wikimedia Foundation, 2014. http://en.
wikipedia.org/wiki/Simplex_algorithm.
[19] Wikipedia. Nelder-Mead Method. The Wikimedia Foundation, 2014. http://en.
wikipedia.org/wiki/Nelder-Mead_method.
[20] E. G. Romero-Blanco and J. F. Ogilvie. Optimization with sequential simplex of
variable size. Maplesoft, 2002. http://www.maplesoft.com/applications/view.
aspx?SID=4289&view=html.
[21] Design Decisions Wiki. Downhill simplex. Design Decisions Laboratory, 2008. http:
//wiki.ece.cmu.edu/ddl/index.php/Downhill_Simplex.
[22] Sasa Singer and John Nelder. Nelder-Mead algorithm. Scholarpedia, 2009. http:
//www.scholarpedia.org/article/Nelder-Mead_algorithm.

44

Bibliography
[23] Prof. DK Chaturvedi.

Advances in Evolutionary Optimization Techniques.

YouTube, November 2013. https://www.youtube.com/watch?v=ftxiiaHNweQ.


[24] Imperial College London. Colour footage of the Tacoma Narrows bridge. YouTube,
December 2011. https://www.youtube.com/watch?v=qbOjxPCfaFk.
[25] Wikipedia. Shape optimization. The Wikimedia Foundation, 2014. http://en.
wikipedia.org/wiki/Shape_optimization.
[26] Monika Kowalska. Shape Optimization based on Black Box Simulations. Johannes
Kepler Universit
at Linz, M.Sc. Thesis, May 2010. http://www.numa.uni-linz.
ac.at/Teaching/Diplom/Finished/kowalska-dipl.pdf.
[27] Wikipedia. Black box. The Wikimedia Foundation, March 2014. http://en.
wikipedia.org/wiki/Black_box.
[28] Andrea Cassioli. A Tutorial on Black Box Optimization. LIX Ecole polytechnique, April 2013. http://www.lix.polytechnique.fr/~dambrosio/blackbox_
material/Cassioli_1.pdf.
[29] John James Tomick. On Convergence of the Nelder-Mead Simplex Algorithm for
Unconstrained Stochastic Optimization. The Pennsylvania State University, Ph.D.
Thesis, May 1995. http://www.dtic.mil/dtic/tr/fulltext/u2/a289453.pdf.
[30] Brian Kernighan and Dennis Ritchie. m4 macro processor. GNU Project, 1977.
http://www.gnu.org/software/m4/m4.html.
[31] Michael Breen. Notes on the M4 Macro Language. mbreen.com, 2008. http:
//mbreen.com/m4.html.
[32] Wikipedia. Savonius wind turbine. The Wikimedia Foundation, March 2014. http:
//en.wikipedia.org/wiki/Savonius_wind_turbine.

OptiFlow User Guide

45

OptiFlow v0.6.1a

- User Guide 25/03/2014

--------------Version history
---------------

0.6.1a - 06/Mar/2014 0.6.0a - 20/Feb/2014 -

Fixes to Run-Time Procedure


Attach Constraint File Capability

0.5.1a - 02/Feb/2014 0.5.0a - 02/Feb/2014 -

Changed CSV to Tab Delim. for Data Files


Added items to File Menu

0.4.7a
0.4.6a
0.4.5a
0.4.4a
0.4.3a
0.4.2a
0.4.1a
0.4.0a

Misc. Fixes to Plots


Added more Objective Functions
Plot Fixes, detects arcs and sections
Fixes to Plots and Server Access
Fixes to Remote Server Access
Misc. Fixes to GUI, added Timer and Progress Bar
Fixes to Objective Functions and Plots
Added Remote Server Access

31/Jan/2014
30/Jan/2014
28/Jan/2014
19/Jan/2014
08/Jan/2014
18/Dec/2013
12/Dec/2013
09/Dec/2013

0.3.0a - 04/Dec/2013 -

Added Objective Functions

0.2.0a - 25/Nov/2013 -

Windows Support

0.1.1a - 22/Nov/2013 0.1.0a - 21/Nov/2013 -

Updated Example Models


Model Geometry Visualization

0.0.1a - 11/Nov/2013 0.0.0a - 30/Oct/2013 -

Portability Fixes
Release

-------------Future Release
--------------

Add Parallel Optimization Capability


Add Parallel Data Gathering
Send Automated Data Gathering Script to Remote Server
Add the Over-Time Optimization Procedure
Get rid of the M4 and Perl Dependencies
Add Remote Server Access under Windows
Add user constraint to Optimization Algorithms runs
Multi-Server Selection
Deploy using Matlab Deployment Tool
Add general and default optimization results plot
Change Objective Function to accept File as Input parameter
Add ability to define variables as constraints
Add header for Data Files and Optimization Results Files
Collect and save all data from VXFLOW on each function evaluation
Let user choose different outputs for Plots and Data Files
Let user choose output location for optimization results (not OptiOUT Fldr)
Add timer and progress-bar for the Run-Time Procedure
Add on/off switch for panels nodes display
Add Wind-Speed Plot
Dynamic GUI and Menus, auto-detect functions and populate menus accordingly
Make Instructive Guide for adding support with other programs besides VXFLOW
Add Parametrization using a GUI
Change code to Object-Oriented-Programming (OOP) style

Contents
Version History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Future Release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

ii
iii

Contents

1 Introduction
1.1 About OptiFlow . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1
1
2
2

2 OptiFlow GUI
2.1 Main Window . . . . . . . . . . .
2.2 Menu Bar . . . . . . . . . . . . . .
2.2.1 File Menu . . . . . . . . .
2.2.2 Edit Menu . . . . . . . . .
Preferences . . . . . . . . . . . . .
Remote Server Access . . . . . .
2.2.3 Build Menu . . . . . . . .
2.2.4 Data Fit . . . . . . . . . .
2.2.5 Plot Menu . . . . . . . . .
2.2.6 Optimization Menu . . .
2.3 Output Windows . . . . . . . . .
2.3.1 Text Window . . . . . . .
2.3.2 Plot Window . . . . . . .
2.3.3 Model Geometry Window

.
.
.
.
.
.
.
.
.
.
.
.
.
.

3
3
4
4
5
5
6
7
7
8
8
10
10
10
10

3 OptiFlow Ini File


3.1 optiflow.ini File . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11
11

4 Data
4.1 Data File (*.dat) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2 Data Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

15
15
15

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.

CONTENTS

ii

5 Optimization
5.1 Pre-Run Optimization . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 Run-Time Optimization . . . . . . . . . . . . . . . . . . . . . . . .

17
17
18

Appendices

19

I M4-Neath Viaduct Wind Shield

20

II Savonius Wind Turbine

33

Chapter 1

Introduction
1.1

About OptiFlow

OptiFlow is a CFD Optimization Tool written in MATLAB . It uses MATLAB


built-in Functions for Data-Fitting and Optimization to manipulate data and solve
optimization problems. The user is able to use the program by using a userfriendly GUI or by modifying a text file.
This User Guide will cover the following topics:
1. Navigation of the GUI
2. The OptiFlow Input File
3. Data Gathering
4. Run Optimization Model
5. Build Optimization Model

Figure 1.1: OptiFlow Flowchart

At the end of this Guide we provide some simple tutorial examples to help you
get started in modeling optimization problems.

CHAPTER 1. INTRODUCTION

1.2

System Requirements

Operating System: Linux (Recommended) or Windows 1


MATLAB
VXFLOW
m4 (Optional)
Perl (Optional)

1.3

Installation

OptiFlow requires VXFLOW, as the Fluid Dynamic Solver, to generate data and
run the optimization algorithms with. For the VXFLOW installation, it is recommended to follow the instructions in the VXFLOW Primer.
The m4 macro Language is already provide in the package of file with OptiFlow,
so there is no need to search an install it.
Perl is usually already provided in Linux distributions, but you might need to install it for Windows. You can download it from http://www.perl.org/get.html.
OptiFlow is made up by several MATLAB functions, the main program file is
optiflow.m. To run OptiFlow just type:
>> optiflow

on MATLABs command line, while being in optiflows root folder.


Also you may want to add optiflows address to MATLABs search path.

Remote Server Access unavailable on Windows

Chapter 2

OptiFlow GUI
2.1

Main Window

Figure 2.1: OptiFlow Main Window

This is OptiFlows Main Window, here is where we will be navigating through the
main options of the program. You should take special attention to the title of the
window, where the program will be updating with the names of the Models and
Data Files loaded in to the program, if any. Also a -S will be appended when
the Remote Server is activated and/or a -P when parallel computing is active,
check out the Preferences Menu 2.2.2 for more information. We now proceed to
explain each of the elements of the OptiFlow Main Window.

CHAPTER 2. OPTIFLOW GUI

2.2

Menu Bar

2.2.1

File Menu

Open
This will open compatible files using the default OS
text editor. Compatible files are: *.opt, *.in13, *.m,
*.dat. For *.in13 files (VXFLOW Files) the geometry
is plotted on the Geometry Plot Window.
Figure 2.2: File Menu

Copy File As
Lets you select a file and copy it with another name or different file type. This
might be helpful to start generating the optimization model files, if a verbatim
copy of a file is desired.
Load
Used to Load the Optimization Model. It will first ask for the Model Folder and
then for the Parameter File(*.opt) and then the Objective Function File (*.m)
Load Data
Loads a previously saved Data File. Compatible files have *.dat extensions,
and have tab delimited values. In order to use a data file, a optimization model
requires to be loaded.
Exit
Closes the Program.

CHAPTER 2. OPTIFLOW GUI

2.2.2

Edit Menu

Preferences
Set global preferences for the OptiFlow program, this are:
Boundaries Offset
Number of Cores for Parallel Computing
Path for executable program to be used by OptiFlow
Default Models Path search path
Remote Server Access

Figure 2.3: Preferences Menu

CHAPTER 2. OPTIFLOW GUI

Remote Server Access (Linux Only)


In order to automate the optimization process using a server, further configuration of the server is required. To do this you arent required to have physical
access to the server, but you do need to know its IP address and password. We
need to apply this configuration in order to avoid being asked for the servers
password on each call to the server.
For OpenSSH, we do this by creating public/private keys for your computer,
which are used by the server to identify and allow access for you personal computer. To start generating your keys type on the terminal:
$ sshkeygen

You will be asked for a passphrase. This is your personal passphrase, this is
NOT the servers password. So type in your preferred passphrase and dont forget it. Also take note to the location where the keys are saved.
Now we need to add the generate public-key to the remote server. To do this
type in the terminal:
$ sshcopyid i /.ssh/id rsa.pub user@remote.server.ip

Now you will be asked for the remote servers password, type it in and you are
done. From now on you will be asked for your personal passphrase in order to
access the remote server.
But we still cant run automated scripts without being asked for the passphrase
To avoid this we make use of ssh-agent. Any commands which require access
to your OpenSSH private-keys will be intercepted and answered by ssh-agent.
So now we only need to supply ssh-agent with your keys, we do so by typing:
$ sshadd

Just provide your passphrase one last time and you are done. Now you are able
to run automated scripts on the server, therefore we are able to automate the
optimization process using OptiFlow and the Remote Server.

CHAPTER 2. OPTIFLOW GUI

2.2.3

Build Menu

Data File (*.dat)


Select this to Build the Data File. Only works with a
previously loaded Optimization Model.
Parameter File (*.opt)

Figure 2.4: Build Menu

Use this to build the Parameter File. You will be asked to select a file to convert
to a parametrized format.
Objective File (*.m)
Use this to build your Objective Function File. A default template will be loaded
which you can modify.
Run Macro
This lets you run a built Macro File (*.opt File) so that you can check if the output
file is generated correctly.

2.2.4 Data Fit


With a data file loaded, you can use this
option to fit the data points with the datafit models provided, which are:
Interpolation
Linear
Cubic

Figure 2.5: Data Fit Menu

Hermite

Smoothing
Polynomial
Settings
This sets the settings for the data fitting. Here you will be able to set the interval
and mesh size for the data fitting.

CHAPTER 2. OPTIFLOW GUI

2.2.5

Plot Menu

Points
Plots the data points that are currently loaded in
OptiFlow.
Function
Plots the fit function that has been previously chosen.
Figure 2.6: Plot Menu

Hold On
If checked, all plots will be overlapped. If unchecked, plots will not overlap each
other.
Clear
Clear the Plot Window.

2.2.6 Optimization Menu


Algorithm
Here you should select the correct optimization algorithm
type, between local or global. You can also select a userdefined algorithm.
Check MATLABs Documentation for more information
about the Optimization Algorithms.
Figure 2.7:
Optimization Menu

CHAPTER 2. OPTIFLOW GUI

Run ...
After choosing the Optimization Algorithm you need to select Run to bring up
the Optimization Run Window. Here you have the option of configuring the Optimization Run, by choosing an Initial guess, Lower and Upper Bounds, Tolerance
and the Type of Run you wish to run, which can be:
pre-run: This requires a previously loaded Data File, refer to Section 5.1
for details.
run-time: Optimization is made on-the-fly, you just need to set-up the Optimization Model and load it to OptiFlow, for more information refer to Section 5.2.
over-time: As in the previous one you just need to load an Optimization
Model for this to work. The optimization is made on each time step of the
simulation. The optimization will end when the simulation ends. Refer to
Section ?? for details. Not yet Implemented.

Figure 2.8: Optimization Run Window

CHAPTER 2. OPTIFLOW GUI

2.3
2.3.1

10

Output Windows
Text Window

Here we output generated data values and optimization run results in text format.

2.3.2

Plot Window

Here results are plotted about the data points, functions and the optimization
algorithms search values.

2.3.3

Model Geometry Window

Here we plot the current model geometry, with nodes and panel points.

Chapter 3

OptiFlow Ini File


3.1

optiflow.ini File

This is OptiFlows Initialization Input File. This file can be modified without using
the GUI to run OptiFlow with the parameters define in this file. The file is formatted in such a way in which we define the variable name first and make it equal to
a value for this variable (Example: Algorithm=simplex); No spaces are allowed.
The program automatically detects the following types of variables:
bool
int8
double
function
array
string

Loaded=false
Dim=2
Tol=1e-3
Function=@(x)20 x. 2 + 55
Values=[0 0.1 1; 0 0.5 3]
PATH= /optiflow/simple.vxf/

Each item of the file is assigned a Category and built in to a single Struct Data
Type (called OFDATA) at the initialization of the Program. The format is as follows:
<CATEGORY(1) >
NAME(1)=value(1)
NAME(2)=value(2)
... the rest of the variables for CATEGORY(1) ...
... the rest of the CATEGORIES and Variables ...
The general OFDATA Struct is of the form OFDATA.CATEGORY.NAME, which
stores any of the previously stated variables types.
11

12

CHAPTER 3. OPTIFLOW INI FILE

We explain now each of the possible entries in the optiflow.ini file and the values
they can be assigned to.
Table 3.1: optiflow.ini File Items

Item (default)

Data Type

Description

File
Load (false)

Boolean

Saved (false)

Boolean

ini (true)

Boolean

txt (false)

Boolean

FILE

String

PATH

String

Set to true to load an optiflow save file Unused.


The value is true if the file has been saved,
false otherwise. Unused.
Set to true to load initialization values from
the *.ini file. Unused.
Set to true to run optiflow in text-based Unused.
File Name of the optiflow Save File (*.of).
Requires Load to be set true. Unused.
File Path for the optiflow Save File (*.of). Requires Load to be set to true. Unused.

Preferences
BoundOffset (0.02)
Cores (1)
Server (false)

int8
int8
Boolean

SrvIp
SrvProg
SrvProgFlag

String
String
int8

SrvFldr
PROG PATH

String
String

Value to Offset Boundary Values


Number of Cores for Parallel Computing
Set to (false) to have access to remote
server
IP Address for the Remote Server
Program COmmand to use on the Server
An integer valued flag to configure run of the
Program on Server
Server Folder to use for processing files
Program Executable Address on Local Computer

Model
Loaded (false)
FILE
PATH

Boolean
String
String

Value is true if Model has been Loaded


Unused.
Path for the Model Folder. Requires Loaded
to be set true

13

CHAPTER 3. OPTIFLOW INI FILE

Table 3.1 continued ...

Item (default)

Data Type

Description

Variables
N
Names
Values

int8
Array
Array

FILE

String

Number of Variables
Array of Names of the Variables
Stores Array of values for each variable. It
has the form: [Initial Step Final].
File Name of the Parameter File (*.opt)

int8
Array
String

Number of Objectives
Array of Names of the Objectives
File Name of the Objective File (*.m)

Loaded (false)
FILE
Values

Boolean
String
Array

PATH

String

Value is true if Data has been Loaded


File Name of Data File
Array of values for data gathering. It has the
form: [ Initial Step Final ]
Path of Data File

Objectives
N
Names
FILE
Data

DataFit
Run (false)

Boolean

Range

Array

Options

Struct

Set to true to run the Data Fit Methods. Unused


Main data fit function handle
Method of Data Fit for Main Function. This
can be: Interpolation, Smoothing or Polynomial.
Type of the Data Fit Method
Secondary data fit function handle
Method of Data Fit for Secondary Function
Type of the Data Fit Method for the Secondary Function
Array for the data mesh grid to fit. It has the
form: [ x1 Step x2 ]
More options for the Data Fit. Unused

Function
Method (smoothing)

Function
String

Type (linear)
Function2
Method2 (smoothing)
Type2 (linear)

String/int8
Function
String
String/int8

Boolean
Boolean
Struct

Set to true to plot results on the GUI


Set to true to hold the plots on the GUI
Plotting Options. Unused

Plot
Plot (false)
HoldOn (true)
Options

14

CHAPTER 3. OPTIFLOW INI FILE

Table 3.1 continued ...

Item (default)

Data Type

Description

Optimization
Run (false)

Boolean

Algorithm (simplex)

String

RunType (pre-run)

String

Values

Array

Constraint (false)

Boolean/String

Tol (1e-3)

Double

Options

Struct

Set to true to run the Optimization Algorithms. Unused


Name of the Optimization Algorithm to use.
This can be: Golden, Simplex, Newton, PS
or GA.
Name of the Type of Optimization Run to
use. This can be: pre-run, run-time or overtime.
Array for the values to use by the Optimization Algorithm. It has the form: [ Initial
Guess, Lower Bound, Upper Bound ]
It is false if no Constaint File is attached,
otherwise contains the File Path of the Cosntraint File
Tolerance for the Optimization Algorithm; affects precision and speed
Options for the Optimization Algorithms. Unused.

Chapter 4

Data
4.1

Data File (*.dat)

This is a text-based tab-delimited file which contains data points from the variables and the evaluation of the objective function on this points.
Variable#1
Variable#1
..
.
Variable#1

Variable#2
Variable#2
..
.
Variable#2

...
...
..
.
...

Variable#n
Variable#n
..
.
Variable#n

Objective#1
Objective#1
..
.
Objective#1

...
...
..
.
...

Objective#m
Objective#m
..
.
Objective#m

This data file must be used for the pre-run optimization procedure only. A fit
function must be generated first from this data in order to apply the optimization.
Then this data can be plotted and viewed on the OptiFlow GUI Window.

4.2

Data Generation

Data generation is automated by using the Optimization Model Files, please refer to section ??. Data can also be generated in several runs and append the
new data to a previously generated file.
To start generating the data file you will first need to load an optimization model.
You can do this by going to File Load ... .
After an Optimization Model has been loaded, you can proceed to gather data
by following the menu sequence Build Data File (*.dat). After selecting this,
another window appears, like the one shown in Fig. 2.8, asking for values of the
variables. The number of rows here depend on the number of variables defined
in the Parameter File. Proceed to assign your desired values for your variables.
15

CHAPTER 4. DATA

16

This window asks for the Initial Value, Step Size and Final Value for the variables. After this, the program asks your for a filename for your data file to be
save with, assign it an appropriate name and save it. Then the program starts
to generate the data file by iteratively changing the values of the variables and
proceeding with the next ones, until all combinations are evaluated and the data
file is complete, attaching the evaluated values of the objective function on each
iteration to the generated file.

Chapter 5

Optimization
5.1

Pre-Run Optimization

For this optimization procedure we need both a data file and the corresponding
optimization model, which are used to make a fit function. Then we use this
function as the objective function of the optimization and run the algorithm to
find the optimization value. We explain the step-by-step procedure, using the
GUI, below:
1. Load Model: Go to File Load ... Search for the Model Folder and
load it. Then load the corresponding Parameter File and Objective File for
this model.
2. Load Data File: Go to File Load Data ... Search for the data file and
open it.
3. Generate Fit Function: Choose a Data Fit method from the Data Fit
menu. Once a Data Fit method has been chosen, the data fitting procedure
will run and plot the generated function automatically.
4. Settings: Check the Data Fit Settings if you want to further customize
or change the settings of the data fitting.
5. Choose Algorithm: Choose an optimization algorithm from Optimization menu.
6. Run Optimization: Choose Optimization Run ... and a new window
should appear. Fill in the required information correctly and press Run to
run the Optimization. The program will start searching for the Optimization
Value, printing results on each step on the output window and on a results
*.dat file in the optiOUT Folder.
17

CHAPTER 5. OPTIMIZATION

5.2

18

Run-Time Optimization

For this Optimization Procedure we only need the Optimization Model, please refer to Chapter ?? for more information on how to create this Optimization Model.
Optimization here is made on-the-fly, there is no need to generate a data file
nor a fit function, you just need to set-up the Optimization Model and load it to
OptiFlow. The program will search for the Optimization Value running the CFD
Program in Tandem. The step-by-step procedure, using the GUI, is as follows:
1. Load Model: Go to File Load ... Search for the Model Folder and
load it. Then load the corresponding Parameter File and Objective File for
this model.
2. Choose Algorithm: Choose an optimization algorithm from Optimization menu.
3. Run Optimization: Choose Optimization Run ... and a new window
should appear. Fill in the required information correctly and press Run to
run the Optimization. The program will start searching for the Optimization
Value, printing results on each step on the output window and on a results
*.dat file in the optiOUT Folder.

Tutorials

19

Example I

M4-Neath Viaduct Wind Shield


Description
In this example we try to find the optimum vertical positioning of the VXFLOW
tutorial example M4 Neath Viaduct Wind Shield.

Figure I.1: M4 Neath Viaduct Wind Shield

We placed 4 small sections in the freeway just to obtain the interior drag forces
in this region.

20

EXAMPLE I. M4-NEATH VIADUCT WIND SHIELD

21

Figure I.2: Wind Shield

We define the optimization variable as h, which is the height of the Wind Shield.
The other parameters of the simulation are also shown in the figure.

Optimization Model
Parameter File
The following are the contents of the Parameter File (M4 Neath ViaductWS.opt):
divert(1)
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# M4 Macro to Build the Model File
# Build by typing in terminal:
# m4 M4 Neath ViaductWS.opt > M4 Neath ViaductWS.in13
changequote([,]) # Changes quoting
# Detect OS
define(OS, [esyscmd([perl e 'print($O)'])])
# calc Function Definition
# This Function is used for making calculation
ifelse(OS,linux,[#]) define(calc,[esyscmd(perl e printf($1))])
define(calc, [esyscmd(perl e 'printf($1)')])
# Definition of Useful Functions and Constants
define(tan, [(sin($1))/(cos($1))]) # Tan Function
define(PI, 3.14159265359)
# Pi Constant
# Variables Definitions:

EXAMPLE I. M4-NEATH VIADUCT WIND SHIELD

[begin{variables}]
define(h, @)
# Height of Wind Screen
[end{variables}]
define(L, 3.00)
define(t, 0.15)

# Wind Screen Length


# Wind Screen Width

# Wind Screen Coordinates


define(x1, calc(013.00))
define(x2, calc(x1t))
define(y1, calc(h0.25))
define(y2, calc(y1+L))
# Mesh Handling:
define(n1, 2)
define(n2, 15)
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# End of M4 definitions
divert(0)dnl
NSLICES=1
U0X=40.0
VISCTY=0.000015
DIFFU=1
DELTAT=1.5
NSTEPS=1000
NPANELFACT=1.0
FASTMODE=2
TINTEGR=1
SURF=2
INSIDE=2
CROSS=0
COREMODEL=2
NR=3
P3MINTP=2
P3MFD=2
P3MNRRELAX=20
PVARY=1
NSUBP=3
P3MSH=3
SHSUBST=5
RMSHST=2
RMSHREF=1
RMSHRESP=1
RMSHRELAX=70
!WINMINX=16.0
!WINMAXX=16.0
!WINMINY=8.0
!WINMAXY=8.0
WINMINX=20.0

22

EXAMPLE I. M4-NEATH VIADUCT WIND SHIELD

WINMAXX=220.0
WINMINY=60.0
WINMAXY=60.0
OUTSTEP=20
OUTFLGRID1=0
NORMDSPL=0.2
NORMLIFT=1.0
PRFL=0
PRSTEP=1
SKFL=0
SKSTEP=5
FVFL=0
FVSTEP=5
VXFL=0
VXSTEP=5
VIZFL=0
ISOMINX=14.0
ISOMAXX=26.0
ISOMINY=9.0
ISOMAXY=11.0
ISODIMX=200
ISODIMY=100
GRFL=0
GRSTEP=100
RSTFL=0
RSTSTEP=250
!!
NUMSEC=14
GEOMROT=0.0
GRIDMINX=20.0
GRIDMAXX=220.0
GRIDNX=511
GRIDMINY=59.883
GRIDMAXY=59.883
GRIDNY=255
CORER=1.2
SLCOLORDRAG=2
SLCOLORLIFT=4
SLCOLORMOMENT=1
SLCOLORDSPL=2
SLCOLORROT=5
!!
68 //num cornerpoints****MAIN2
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 13.2 0.27 2
1 13.2 0.66 1
1 13.08 0.66 1
1 13.08 0.86 3
1 12.39 0.83 8

23

EXAMPLE I. M4-NEATH VIADUCT WIND SHIELD

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

12.18 2.33 5
11.21 2.293 8
11.0 0.785 3
10.44 0.764 8
10.23 2.256 5
9.26 2.219 8
9.05 0.711 3
8.49 0.690 8
8.28 2.182 5
7.31 2.145 8
7.1 0.637 3
6.54 0.616 8
6.33 2.108 5
5.36 2.071 8
5.15 0.563 3
4.59 0.541 8
4.38 2.034 5
3.41 1.997 8
3.2 0.489 3
2.64 0.467 8
2.43 1.960 5
1.46 1.923 8
1.25 0.415 3
0.69 0.393 8
0.48 1.885 5
0.49 1.848 8
0.7 0.340 3
1.26 0.319 8
1.47 1.811 5
2.44 1.774 8
2.65 0.266 3
3.21 0.245 8
3.42 1.737 5
4.39 1.700 8
4.6 0.192 3
5.16 0.171 8
5.37 1.663 5
6.34 1.626 8
6.55 0.118 3
7.11 0.097 8
7.32 1.589 5
8.29 1.552 8
8.5 0.044 3
9.06 0.023 8
9.27 1.515 5
10.24 1.478 8
10.45 0.030 3
11.01 0.051 8
11.22 1.44 5
12.18 1.40 8
12.39 0.11 3

24

EXAMPLE I. M4-NEATH VIADUCT WIND SHIELD

1 13.08 0.14 1
1 13.08 0.34 1
1 13.2 0.34 2
1 13.2 0.73 3
1 12.7 0.71 3
1 12.1 0.46 53
1 1.5 0.0 1
1 1.5 0.1 15
1 1.5 0.01 1
1 1.5 0.11 53
1 12.1 0.46 3
1 12.7 0.25 3
4 //num cornerpoints**PARA1UPSTREAM
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 12.8 0.02 2
1 12.7 0.02 1
1 12.7 0.07 2
1 12.8 0.07 1
4 //num cornerpoints**PARA2UP
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 12.8 0.34 2
1 12.7 0.34 1
1 12.7 0.39 2
1 12.8 0.39 1
4 //num cornerpoints**PARA3UP
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 12.8 0.66 2
1 12.7 0.66 1
1 12.7 0.71 2
1 12.8 0.71 1
4 //num cornerpoints**PARA1DOWN
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 12.7 0.98 2
1 12.8 0.98 1
1 12.8 1.03 2
1 12.7 1.03 1
4 //num cornerpoints**PARA2DOWN
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 12.7 1.30 2
1 12.8 1.30 1
1 12.8 1.35 2

25

EXAMPLE I. M4-NEATH VIADUCT WIND SHIELD

1 12.7 1.35 1
4 //num cornerpoints**PARA3DOWN
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 12.7 1.62 2
1 12.8 1.62 1
1 12.8 1.67 2
1 12.7 1.67 1
4 //num cornerpoints** PARA MID DESIGN2 LEFT
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 0.23 0.63 3
1 0.08 0.6 3
1 0.08 0.8 3
1 0.23 0.77 3
4 //num cornerpoints** PARA MID DESIGN2 RIGHT
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 0.08 0.6 3
1 0.23 0.63 3
1 0.23 0.77 3
1 0.08 0.8 3
4 //num cornerpoints**SCREEN3(SCHEME3)
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 x2 y1 n1
1 x1 y1 n2
1 x1 y2 n1
1 x2 y2 n2
4 //num cornerpoints** CM VEHICLES 1UP
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 9.05 0.25
2
1 8.95 0.25
2
1 8.95 0.35
2
1 9.05 0.35
2
4 //num cornerpoints** CM VEHICLES 2UP
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 4.55 0.450
2
1 4.45 0.450
2
1 4.45 0.550
2
1 4.55 0.550
2
4 //num cornerpoints**CM VEHICLES 1DOWN
0.3 0.0 //release distance*spacing hull

26

EXAMPLE I. M4-NEATH VIADUCT WIND SHIELD

27

0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4


4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 4.45 0.700
2
1 4.55 0.700
2
1 4.55 0.800
2
1 4.45 0.800
2
4 //num cornerpoints**CM VEHICLES 2DOWN
0.3 0.0 //release distance*spacing hull
0.02 0.001 0.0 0.1 //merg1*merg2*merg3*merg4
4 3 1 3 1 //section color coding:drag*lift*moment*displ*rotation
1 8.95 0.950
2
1 9.05 0.950
2
1 9.05 1.050
2
1 8.95 1.050
2

Objective Function
For this optimization problem our objective is to minimize the drag force for vehicle passing by, therefore we have placed 4 small sections on the freeway just
to obtain the drag force on this points. Our Objective will be to Minimize the
Maximum of these Drags.
The Objective Function File is as follows:
function [Drag] = M4 Neath ViaductWS(X)
%% M4 Neath ViaductWS Objective Function
steps = 500;
Drag(1)
Drag(2)
Drag(3)
Drag(4)

=
=
=
=

VXF
VXF
VXF
VXF

FORCES(X,'DRAG','MAX',steps,'SECTION',11);
FORCES(X,'DRAG','MAX',steps,'eval',false,'SECTION',12);
FORCES(X,'DRAG','MAX',steps,'eval',false,'SECTION',13);
FORCES(X,'DRAG','MAX',steps,'eval',false,'SECTION',14);

[Drag,Lane] = max(Drag(:))
% Call optiOUT to generate Plots and Output Data
optiOUT(X, [Drag]);
end

EXAMPLE I. M4-NEATH VIADUCT WIND SHIELD

28

Data Gathering
1. First we need to Load the Optimization Model. To do this go to File
Load, a search window will ask you for the model folder location. After
choosing the folder, it will ask for both the parameter file (*.opt) and the
objective function file (*.m).

Figure I.3: Load Model

2. Now go to Data Make ..., and set the Targets Values as shown. After
this, assign a name to the Data File to save it.

Figure I.4: Set Variables Values Window

EXAMPLE I. M4-NEATH VIADUCT WIND SHIELD

29

3. Now we will generate our Data Fit Function. For this example we will
choose Data Fit Smoothing.

Figure I.5: Smoothing Data Fit

After all this you should the Main Window should look the figure below:

Figure I.6: Plots of Optimization Model

EXAMPLE I. M4-NEATH VIADUCT WIND SHIELD

30

pre-run Optimization
1. Choose the Golden Section Optimization Algorithm through Optimization
Local Golden Section.
2. Then run the Optimization by going to Optimization Run ... . A new
window will appear, fill the values as shown and press run.

Figure I.7: Run Window

3. Finally the Optimization Runs, and results are printed out.

Figure I.8: pre-run Results

EXAMPLE I. M4-NEATH VIADUCT WIND SHIELD

31

run-time Optimization
1. First Load the Optimization using File Load.
2. Then Choose the Golden Section Algorithm from the Optimization Menu.
3. Then run the Optimization by going to Optimization Run ... . A new
window will appear, fill the values as shown and press run.

Figure I.9: Run Window

4. Finally the Optimization Runs, and results are printed out.

Figure I.10: run-time Wind Shield Example Results

EXAMPLE I. M4-NEATH VIADUCT WIND SHIELD

32

Results Summary
We summarize the optimization results obtained from each run type on the table
below:
Table I.1: Results Summary

Run Type
pre-run
run-time

h
0.2
0.23607

Drag
87.43
61.109

The Final Shape of the Optimized Wind Shield is :

Figure I.11: Wind Shield Height: h = 0.25

Example II

Savonius Wind Turbine


Description
The Savonius Wind Turbine is a Vertical-Axis Wind Turbine (VAWT) which main
advantages are its reliability and practicality. The optimization problem is to find
the optimum values for the eccentricity variables (ex and e y ) in order to maximize
Moment or Power depending on the model type. The parameters of the wind
turbine have been taken from the dimensions of an empty oil drum, and are
summarized in the figure below:

Figure II.1: Savonius Turbine

For this model we have bounded the variables to the shaded area shown above,
which are:
ex = [0 0.5]
e y = [0 0.5]
33

EXAMPLE II. SAVONIUS WIND TURBINE

34

Optimization Model
For the Solution of this Optimization problem we used 2 types of CFD Models:
Static Model
Dynamic Model

Parameter File
The following are the contents of the Parameter File (savonius.opt):
divert(1)
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# M4 Macro to Build the Model File
# Build by typing in terminal:
# m4 rotor static m.opt > rotor static m.in13
changequote([,]) # Changes quoting
# Detect OS
define(OS, [esyscmd([perl e 'print($O)'])])
# calc Function Definition
# This Function is used for making calculation
ifelse(OS,linux,[#]) define(calc,[esyscmd(perl e printf($1))])
define(calc, [esyscmd(perl e 'printf($1)')])
# Definition of Useful Functions and Constants
define(tan, [(sin($1))/(cos($1))]) # Tan Function
define(PI, 3.14159265359)
# Pi Constant
define(Imper, calc(PI/300))
# Variables Definitions:
[begin{variables}]
define(ex, calc(0.1+Imper))
define(ey, calc(0.1+Imper))
[end{variables}]

# Small Imperfection

# Eccentricity in XDir
# Eccentricity in YDir

# Rotor Dimensions:
define(D1, 0.572) # Rotor Inside Diameter
define(D2, 0.584) # Rotor Outside Diameter
define(t, calc(D2D1)) # Rotor Thickness

# Coord. Calculations:
# Section 1
define(x1, calc((ex/2)))

EXAMPLE II. SAVONIUS WIND TURBINE

define(y11,
define(y12,
define(y13,
define(y14,

calc(D1(ey/2)))
calc(y11D1))
calc(y12t))
calc(y11+t))

define(xc1, calc((ex/2)))
define(yc1, calc(y11D1/2))
#define(yc12, calc(y13+D2/2))

# Section 2
define(x2, calc(ex/2))
define(y21,
define(y22,
define(y23,
define(y24,

calc(D1+(ey/2)))
calc(y21+D1))
calc(y22+t))
calc(y21t))

define(xc2, calc(ex/2))
define(yc2, calc(y21+D1/2))
#define(yc22, calc(y23D2/2))

# Mesh Handler:
# Here control the Mesh of the Model to be Adequate.
define(ms, 0.05)
# Avg. Mesh Size
define(nd1, calc(int(D1/ms)+1)) # Panels for D1
define(nd2, calc(int(D2/ms)+1)) # Panels for D2
define(nt, calc(int(t/ms)+1))
# Panels for Thickness
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# End of M4 definitions
divert(0)dnl
NSLICES=1
U0X=5
DENSTY=1.2
VISCTY=0.000015
DIFFU=1
DELTAT=1
NSTEPS=500
NPANELFACT=1
PRFL=0
PRSTEP=1
SKFL=0
SKSTEP=5

35

EXAMPLE II. SAVONIUS WIND TURBINE

FVFL=0
FVSTEP=5
VXFL=0
VXSTEP=5
VIZFL=0
ISOMINX=2
ISOMAXX=2
ISOMINY=1
ISOMAXY=1
ISODIMX=200
ISODIMY=100
!!
NUMSEC=2
GEOMROT=0
GRIDMINX=4
GRIDMAXX=4
GRIDNX=255
GRIDMINY=2
GRIDMAXY=2
GRIDNY=127
CORER=1.2
AVGPRESS=1
!!
4 //num cornerpoints
0.2 0.0 //release distance*spacing hull
0.0 0.002 0.0 0.02 //merg1*merg2*merg3*merg4
4 4 1 3 1 //section color coding:drag*lift*moment*displ*rotation
3
x1
y11
nd1
xc1
yc1
1
x1
y12
nt
2
x1
y13
nd2
xc1
yc1
1
x1
y14
nt
4 //num cornerpoints
0.2 0.0 //release distance*spacing hull
0.0 0.002 0.0 0.02 //merg1*merg2*merg3*merg4
4 4 1 3 1 //section color coding:drag*lift*moment*displ*rotation
3
x2 y21
nd1
xc2
yc2
1
x2
y22
nt
2
x2
y23
nd2
xc2
yc2
1
x2
y24
nt

36

EXAMPLE II. SAVONIUS WIND TURBINE

37

For the Dynamic Model the only difference is the addition of the Dynamic Parameters to the CFD input data of the Parameter File (savonius.opt), which are
the following:
DYNAMIC=1
STRCMODEL=1
DAMPRATIO=1.0
RAYLA0=0.0
RAYLA1=0.0
ASEC0=5E3
ASEC1=5E3
MASS11=0.0
MASS12=0.0
MASS21=0.0
MASS22=1.0
STIFF11=9E9
STIFF12=0.0
STIFF21=0.0
STIFF22=0.0

Objective Function
Our Objective Function for this Optimization Problem is to find the Maximum
Moment of the Parametrized Savonius Turbine, expressed as Max(Mo(x)).
The Objective Function for the static model is the following:
function [Mo] = rotor static(X)
%% rotor static Objective Function
Mo = VXF FORCES(X,'MOMENT');
% Call optiOUT to generate Plots and Output Data
optiOUT(X, [Mo]);
end

EXAMPLE II. SAVONIUS WIND TURBINE

38

The Pseudo-Dynamic Model consists on rotating the Geometry around 360 at


steps of 45 and averaging the values of the Moment. The Objective File for the
Pseudo-Dynamic case is the following:
function [AvgMo] = rotor pseudo static(X)
%% rotor pseudo static Objective Function
[DMdr, AvgMo] = VXF DERIV(X,'MOMENT','GEOMROT',[180 45 180])
AvgMo = mean(AvgMo); DMdr = mean(DMdr);
% Call optiOUT to generate Plots and Output Data
optiOUT(X, [AvgMo]);
end

The Dynamic Model contains the following objective function:


function [Power] = rotor dyna(X)
%% rotor dyna Objective Function
Variables = getappdata(0,'Variables'); % Variables Data
modelPATH = getappdata(0,'modelPATH'); % Model Path
% Savonious Rotor Data
D = 0.578; % Rotor Avg Diameter [m]
m = 10;
% Mass [kg]
% Calculate Arm vector
Arm = [X(1)/2, X(2)/2] + [(4/6)*D/pi, D/2];
Arm = norm(Arm);
% Calculate Inertial Mass
Mass = 2*m*Arm2;
m4Mod('MASS22',Mass,fullfile(modelPATH, Variables.FILE));
% Angular Velocity
Omega = VXF DERIV(X,'RDISPL','TIME',50,'SECTION',1);
Omega = mean(Omega);
% Torsional Force
Torque = VXF FORCES(X,'MOMENT','MEAN',50,'eval',false);
Power = Torque * Omega;
% Call optiOUT to generate Plots and Output Data
optiOUT(X, [Power]);
end

39

EXAMPLE II. SAVONIUS WIND TURBINE

Results Summary
We summarize the optimization results obtained from each model type on the
table below:
Table II.1: Results Summary

Model Type
Static
Pseudo-Dynamic
Dynamic

ex
0.1
0.075
0.15

ey
0.3
0.1
0.1

Mo
12.33
4.524
-

P
22.93

The Final Shape of the Optimized Savonius Turbine is:

Figure II.2: Savonius Rotor: ex = 0.1, e y = 0.10

You might also like