Table Of Contents

Previous topic

Users’ Guide

Next topic

Developers’ Guide

This Page

Tutorials

This tutorial is intended for users who wish to apply the BladeDesigner. For a developers guide read Developers’ Guide.

How to create a camber line

Imports

In order to create a camber line and visualize it, we need to import some libraries. For visualization purposes we use the popular matplotlib package. Camber lines are available in the bladedesigner.camberlines package. If you’re curious what camber lines are available, check the source code, or use a python shell with auto completion, i.e. ipython. For this tutorial a NACA 2 digit camberline is used, hence N2DCamberLine. In order to discretize the camber line (a required step), a distribution of points along the camber line must be chosen. This tutorial uses a Chebyshev distribution.

1
2
3
4
import matplotlib.pyplot as plt

from bladedesigner.camberlines import N2DCamberLine
from bladedesigner.distributions import Chebyshev

The camber line itself

It is time to start working on the camberline itself. A function is defined (for convenience, because we need it later on) which creates the camber line: Line 7 and 8 initialize the instances for the camber line and for the distribution. The following 3 lines define the camber line and its discretization by setting their parameters. They depend on the type of camber line and discretization and hence may vary for different types. The resulting camber line instance is the returned by the function.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import matplotlib.pyplot as plt

from bladedesigner.camberlines import N2DCamberLine
from bladedesigner.distributions import Chebyshev

def get_n2d_camber_line():
   camber_line = N2DCamberLine()
   camber_line.distribution = Chebyshev()
   camber_line.max_camber = 0.02
   camber_line.max_camber_position = 0.4
   camber_line.sample_rate = 100
   return camber_line

Plotting preperations

Now we need to create a figure for the plotting of the camber line. See the matplotlib documentation and tutorials for details. For convenience a short summary is given: An empty figure is created in line 14, which is filled with a single empty subplot in the following line. Then the grid for the coordinate system is activated. Finally the x- and y-axis are locked together with an aspect ratio of 1 and scaled to the data.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import matplotlib.pyplot as plt

from bladedesigner.camberlines import N2DCamberLine
from bladedesigner.distributions import Chebyshev

def get_n2d_camber_line():
   camber_line = N2DCamberLine()
   camber_line.distribution = Chebyshev()
   camber_line.max_camber = 0.02
   camber_line.max_camber_position = 0.4
   camber_line.sample_rate = 100
   return camber_line

fig = plt.figure()
ax = fig.add_subplot(111)
ax.grid()
ax.set_aspect(1, adjustable="datalim")

Final plotting

In line 19 the camber line function is called and the camber line instance created. All there is left to do is to plot the already created camber line, or its dicrete points respectively.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import matplotlib.pyplot as plt

from bladedesigner.camberlines import N2DCamberLine
from bladedesigner.distributions import Chebyshev

def get_n2d_camber_line():
   camber_line = N2DCamberLine()
   camber_line.distribution = Chebyshev()
   camber_line.max_camber = 0.02
   camber_line.max_camber_position = 0.4
   camber_line.sample_rate = 100
   return camber_line

fig = plt.figure()
ax = fig.add_subplot(111)
ax.grid()
ax.set_aspect(1, adjustable="datalim")

camber_line = get_n2d_camber_line()
camber_line.vector_lines.extend(ax.plot([]))
camber_line.plot_vector()
ax.set_ylim(-0.5, 0.5)
plt.show()

How to create a thickness distribution

Imports

The imports work analogously to the previous camber line section.

1
2
3
4
import matplotlib.pyplot as plt

from bladedesigner.thickness import N4DThickness
from bladedesigner.distributions import Chebyshev

The thickness distribution

A function is created, just like in the previous example, for convenience reasons (we need that function later). The thickness and distribution instances are initialized, and set with parameters.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import matplotlib.pyplot as plt

from bladedesigner.thickness import N4DThickness
from bladedesigner.distributions import Chebyshev


def get_n4d_thickness():
   thickness_distribution = N4DThickness()
   thickness_distribution.distribution = LinearDistribution()
   thickness_distribution.max_thickness = 0.12
   thickness_distribution.sample_rate = 100
   return thickness_distribution

Plotting

Here only the preveously discussed plotting funcations are added.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import matplotlib.pyplot as plt

from bladedesigner.thickness import N4DThickness
from bladedesigner.distributions import Chebyshev


def get_n4d_thickness():
   thickness_distribution = N4DThickness()
   thickness_distribution.distribution = Chebyshev()
   thickness_distribution.max_thickness = 0.12
   thickness_distribution.sample_rate = 100
   return thickness_distribution


fig = plt.figure()
ax = fig.add_subplot(111)
ax.grid()
ax.set_aspect(1, adjustable="datalim")
thickness_distribution = get_n4d_thickness()
thickness_distribution.vector_lines.extend(ax.plot([]))
thickness_distribution.plot_vector()
ax.set_ylim(-0.5, 0.5)
plt.show()

How to design a blade profile

Imports

First we need the matplotlib imports for plotting, as seen in the examples before. Next we import the type of profile we want, which is a super position profile in this tutorial. A distribution is needed again for the discretization. As final imports the camber line and thickness functions from the previous tutorials are needed. Again, if you want to find out which profile types are available, check the source code, or use an interactive python interpreter with autocompletion like ipython.

1
2
3
4
5
6
7
import matplotlib.pyplot as plt

from bladedesigner.profiles import SuperpositionProfile
from bladedesigner.distributions import Chebyshev

from n2dcamberline import get_n2d_camber_line
from n4dthickness import get_n4d_thickness

Next we define a function to create the superposition profile. The first thing to do is to initialize the profile instance. Then some parameters must be defined along with the initialization of the needed distribution, camber line and thickness function.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import matplotlib.pyplot as plt

from bladedesigner.profiles import SuperpositionProfile
from bladedesigner.distributions import Chebyshev

from n2dcamberline import get_n2d_camber_line
from n4dthickness import get_n4d_thickness

def get_superposition_profile():
   profile = SuperpositionProfile()
   profile.closed = False
   profile.distribution = Chebyshev()
   profile.sample_rate = 100
   profile.camber_line = get_n2d_camber_line()
   profile.thickness = get_n4d_thickness()
   return profile

Finally some plotting functionality is added. In this case a little more elaborate than in the previous ones, as we want to plot the camber line, the thickness function as well as the superposition of both.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import matplotlib.pyplot as plt

from bladedesigner.profiles import SuperpositionProfile
from bladedesigner.distributions import Chebyshev

from n2dcamberline import get_n2d_camber_line
from n4dthickness import get_n4d_thickness

def get_superposition_profile():
   profile = SuperpositionProfile()
   profile.closed = False
   profile.distribution = Chebyshev()
   profile.sample_rate = 100
   profile.camber_line = get_n2d_camber_line()
   profile.thickness = get_n4d_thickness()
   return profile

fig = plt.figure()
ax = fig.add_subplot(111)
ax.grid()
ax.set_aspect(1, adjustable="datalim")
profile = get_superposition_profile()
profile.vector_lines.extend(ax.plot([]))
profile.camber_line.vector_lines.extend(ax.plot([]))
profile.thickness.vector_lines.extend(ax.plot([]))
profile.plot_vector()
profile.camber_line.plot_vector()
profile.thickness.plot_vector()
ax.set_ylim(-0.5, 0.5)
plt.show()

How to generate a blade row

ToDo...

How to create a turbomachine

ToDo...