Вы находитесь на странице: 1из 16

lecture3-2017

February 6, 2018

1 Lecture 3
1.1 Create a Bezier spline aerofoil and return its surface points for flow simulation
We’re going to need Numpy, Pylab and the rational Bezier function from Lab 1:

In [1]: %pylab inline


import numpy as np #for the maths
import pylab as pl #for the plotting
from aclab1 import rational_bezier # Bezier function

Populating the interactive namespace from numpy and matplotlib

Next define control points for the upper and lower surfaces and find the leading edge joint
using (p(n) = q(0) = n+nm p(n−1) + n+mm q(1) ) (same as end of Lecture 2):

In [2]: # control points


p = np.array([[1.0, 0.0], [0.5, 0.08],[0.0, -0.05]])
q = np.array([[0.0, 0.1], [0.4, 0.2], [1.0, 0.0]])

# weights
zp = np.array([1, 1, 1, 1])
zq = np.array([1, 1, 1, 1])

# calculate degree
n = np.float(p.shape[0])
m = np.float(q.shape[0])

# calculate connection point


q_start = p_end = (n / (m + n)) * p[-1, :] + (m / (m + n)) * q[0, :]

# and add to control points


pp = np.vstack([p, p_end])
qq = np.vstack([q_start, q])

Plot these control points:

1
In [3]: pl.plot(pp[:, 0], pp[:, 1], 'ko');
pl.plot(qq[:, 0], qq[:, 1], 'ro');

Run rational_bezier to calculate points along the upper and lower surfaces:

In [4]: lower = rational_bezier(pp, zp)


upper = rational_bezier(qq, zq)

2
Next we need to join the lower and upper surface together so that the complete aerofoil surface
can be passed to a flow simulator (remember to remove the duplicated leading edge point):

In [5]: points = np.vstack([lower[0:-2], upper])


print(points)

[[ 1.00000000e+00 0.00000000e+00]
[ 9.85000500e-01 2.33741500e-03]
[ 9.70004000e-01 4.55132000e-03]
[ 9.55013500e-01 6.64420500e-03]
[ 9.40032000e-01 8.61856000e-03]
[ 9.25062500e-01 1.04768750e-02]
[ 9.10108000e-01 1.22216400e-02]
[ 8.95171500e-01 1.38553450e-02]
[ 8.80256000e-01 1.53804800e-02]
[ 8.65364500e-01 1.67995350e-02]
[ 8.50500000e-01 1.81150000e-02]
[ 8.35665500e-01 1.93293650e-02]
[ 8.20864000e-01 2.04451200e-02]
[ 8.06098500e-01 2.14647550e-02]
[ 7.91372000e-01 2.23907600e-02]
[ 7.76687500e-01 2.32256250e-02]
[ 7.62048000e-01 2.39718400e-02]
[ 7.47456500e-01 2.46318950e-02]
[ 7.32916000e-01 2.52082800e-02]
[ 7.18429500e-01 2.57034850e-02]
[ 7.04000000e-01 2.61200000e-02]
[ 6.89630500e-01 2.64603150e-02]
[ 6.75324000e-01 2.67269200e-02]
[ 6.61083500e-01 2.69223050e-02]
[ 6.46912000e-01 2.70489600e-02]
[ 6.32812500e-01 2.71093750e-02]
[ 6.18788000e-01 2.71060400e-02]
[ 6.04841500e-01 2.70414450e-02]
[ 5.90976000e-01 2.69180800e-02]
[ 5.77194500e-01 2.67384350e-02]
[ 5.63500000e-01 2.65050000e-02]
[ 5.49895500e-01 2.62202650e-02]
[ 5.36384000e-01 2.58867200e-02]
[ 5.22968500e-01 2.55068550e-02]
[ 5.09652000e-01 2.50831600e-02]
[ 4.96437500e-01 2.46181250e-02]
[ 4.83328000e-01 2.41142400e-02]
[ 4.70326500e-01 2.35739950e-02]
[ 4.57436000e-01 2.29998800e-02]
[ 4.44659500e-01 2.23943850e-02]

3
[ 4.32000000e-01 2.17600000e-02]
[ 4.19460500e-01 2.10992150e-02]
[ 4.07044000e-01 2.04145200e-02]
[ 3.94753500e-01 1.97084050e-02]
[ 3.82592000e-01 1.89833600e-02]
[ 3.70562500e-01 1.82418750e-02]
[ 3.58668000e-01 1.74864400e-02]
[ 3.46911500e-01 1.67195450e-02]
[ 3.35296000e-01 1.59436800e-02]
[ 3.23824500e-01 1.51613350e-02]
[ 3.12500000e-01 1.43750000e-02]
[ 3.01325500e-01 1.35871650e-02]
[ 2.90304000e-01 1.28003200e-02]
[ 2.79438500e-01 1.20169550e-02]
[ 2.68732000e-01 1.12395600e-02]
[ 2.58187500e-01 1.04706250e-02]
[ 2.47808000e-01 9.71264000e-03]
[ 2.37596500e-01 8.96809500e-03]
[ 2.27556000e-01 8.23948000e-03]
[ 2.17689500e-01 7.52928500e-03]
[ 2.08000000e-01 6.84000000e-03]
[ 1.98490500e-01 6.17411500e-03]
[ 1.89164000e-01 5.53412000e-03]
[ 1.80023500e-01 4.92250500e-03]
[ 1.71072000e-01 4.34176000e-03]
[ 1.62312500e-01 3.79437500e-03]
[ 1.53748000e-01 3.28284000e-03]
[ 1.45381500e-01 2.80964500e-03]
[ 1.37216000e-01 2.37728000e-03]
[ 1.29254500e-01 1.98823500e-03]
[ 1.21500000e-01 1.64500000e-03]
[ 1.13955500e-01 1.35006500e-03]
[ 1.06624000e-01 1.10592000e-03]
[ 9.95085000e-02 9.15055000e-04]
[ 9.26120000e-02 7.79960000e-04]
[ 8.59375000e-02 7.03125000e-04]
[ 7.94880000e-02 6.87040000e-04]
[ 7.32665000e-02 7.34195000e-04]
[ 6.72760000e-02 8.47080000e-04]
[ 6.15195000e-02 1.02818500e-03]
[ 5.60000000e-02 1.28000000e-03]
[ 5.07205000e-02 1.60501500e-03]
[ 4.56840000e-02 2.00572000e-03]
[ 4.08935000e-02 2.48460500e-03]
[ 3.63520000e-02 3.04416000e-03]
[ 3.20625000e-02 3.68687500e-03]
[ 2.80280000e-02 4.41524000e-03]
[ 2.42515000e-02 5.23174500e-03]

4
[ 2.07360000e-02 6.13888000e-03]
[ 1.74845000e-02 7.13913500e-03]
[ 1.45000000e-02 8.23500000e-03]
[ 1.17855000e-02 9.42896500e-03]
[ 9.34400000e-03 1.07235200e-02]
[ 7.17850000e-03 1.21211550e-02]
[ 5.29200000e-03 1.36243600e-02]
[ 3.68750000e-03 1.52356250e-02]
[ 2.36800000e-03 1.69574400e-02]
[ 1.33650000e-03 1.87922950e-02]
[ 5.96000000e-04 2.07426800e-02]
[ 0.00000000e+00 2.50000000e-02]
[ 1.19800000e-04 2.72571750e-02]
[ 4.78400000e-04 2.95274000e-02]
[ 1.07460000e-03 3.18087250e-02]
[ 1.90720000e-03 3.40992000e-02]
[ 2.97500000e-03 3.63968750e-02]
[ 4.27680000e-03 3.86998000e-02]
[ 5.81140000e-03 4.10060250e-02]
[ 7.57760000e-03 4.33136000e-02]
[ 9.57420000e-03 4.56205750e-02]
[ 1.18000000e-02 4.79250000e-02]
[ 1.42538000e-02 5.02249250e-02]
[ 1.69344000e-02 5.25184000e-02]
[ 1.98406000e-02 5.48034750e-02]
[ 2.29712000e-02 5.70782000e-02]
[ 2.63250000e-02 5.93406250e-02]
[ 2.99008000e-02 6.15888000e-02]
[ 3.36974000e-02 6.38207750e-02]
[ 3.77136000e-02 6.60346000e-02]
[ 4.19482000e-02 6.82283250e-02]
[ 4.64000000e-02 7.04000000e-02]
[ 5.10678000e-02 7.25476750e-02]
[ 5.59504000e-02 7.46694000e-02]
[ 6.10466000e-02 7.67632250e-02]
[ 6.63552000e-02 7.88272000e-02]
[ 7.18750000e-02 8.08593750e-02]
[ 7.76048000e-02 8.28578000e-02]
[ 8.35434000e-02 8.48205250e-02]
[ 8.96896000e-02 8.67456000e-02]
[ 9.60422000e-02 8.86310750e-02]
[ 1.02600000e-01 9.04750000e-02]
[ 1.09361800e-01 9.22754250e-02]
[ 1.16326400e-01 9.40304000e-02]
[ 1.23492600e-01 9.57379750e-02]
[ 1.30859200e-01 9.73962000e-02]
[ 1.38425000e-01 9.90031250e-02]
[ 1.46188800e-01 1.00556800e-01]

5
[ 1.54149400e-01 1.02055275e-01]
[ 1.62305600e-01 1.03496600e-01]
[ 1.70656200e-01 1.04878825e-01]
[ 1.79200000e-01 1.06200000e-01]
[ 1.87935800e-01 1.07458175e-01]
[ 1.96862400e-01 1.08651400e-01]
[ 2.05978600e-01 1.09777725e-01]
[ 2.15283200e-01 1.10835200e-01]
[ 2.24775000e-01 1.11821875e-01]
[ 2.34452800e-01 1.12735800e-01]
[ 2.44315400e-01 1.13575025e-01]
[ 2.54361600e-01 1.14337600e-01]
[ 2.64590200e-01 1.15021575e-01]
[ 2.75000000e-01 1.15625000e-01]
[ 2.85589800e-01 1.16145925e-01]
[ 2.96358400e-01 1.16582400e-01]
[ 3.07304600e-01 1.16932475e-01]
[ 3.18427200e-01 1.17194200e-01]
[ 3.29725000e-01 1.17365625e-01]
[ 3.41196800e-01 1.17444800e-01]
[ 3.52841400e-01 1.17429775e-01]
[ 3.64657600e-01 1.17318600e-01]
[ 3.76644200e-01 1.17109325e-01]
[ 3.88800000e-01 1.16800000e-01]
[ 4.01123800e-01 1.16388675e-01]
[ 4.13614400e-01 1.15873400e-01]
[ 4.26270600e-01 1.15252225e-01]
[ 4.39091200e-01 1.14523200e-01]
[ 4.52075000e-01 1.13684375e-01]
[ 4.65220800e-01 1.12733800e-01]
[ 4.78527400e-01 1.11669525e-01]
[ 4.91993600e-01 1.10489600e-01]
[ 5.05618200e-01 1.09192075e-01]
[ 5.19400000e-01 1.07775000e-01]
[ 5.33337800e-01 1.06236425e-01]
[ 5.47430400e-01 1.04574400e-01]
[ 5.61676600e-01 1.02786975e-01]
[ 5.76075200e-01 1.00872200e-01]
[ 5.90625000e-01 9.88281250e-02]
[ 6.05324800e-01 9.66528000e-02]
[ 6.20173400e-01 9.43442750e-02]
[ 6.35169600e-01 9.19006000e-02]
[ 6.50312200e-01 8.93198250e-02]
[ 6.65600000e-01 8.66000000e-02]
[ 6.81031800e-01 8.37391750e-02]
[ 6.96606400e-01 8.07354000e-02]
[ 7.12322600e-01 7.75867250e-02]
[ 7.28179200e-01 7.42912000e-02]

6
[ 7.44175000e-01 7.08468750e-02]
[ 7.60308800e-01 6.72518000e-02]
[ 7.76579400e-01 6.35040250e-02]
[ 7.92985600e-01 5.96016000e-02]
[ 8.09526200e-01 5.55425750e-02]
[ 8.26200000e-01 5.13250000e-02]
[ 8.43005800e-01 4.69469250e-02]
[ 8.59942400e-01 4.24064000e-02]
[ 8.77008600e-01 3.77014750e-02]
[ 8.94203200e-01 3.28302000e-02]
[ 9.11525000e-01 2.77906250e-02]
[ 9.28972800e-01 2.25808000e-02]
[ 9.46545400e-01 1.71987750e-02]
[ 9.64241600e-01 1.16426000e-02]
[ 9.82060200e-01 5.91032500e-03]
[ 1.00000000e+00 0.00000000e+00]]

In [6]: from aclab2 import bezier_spline_aerofoil


points = bezier_spline_aerofoil()
savefig('aerofoil.png')

1.2 Run the potential flow simulator


We will simulate the lift of the aerofoil using a simple panel code vortex_panel, which is provided
in aclabtools:

7
In [7]: from aclabtools import vortex_panel

This function takes three arguments: our array of points along the surface of the aerofoil, the
angle of attack of the aerofoil in degrees, and 1 or 0 depending on if you want the function to
plot the pressure over the aerofoil. The function has three outputs: the lift coefficent, the pres-
sure coefficient over the surface, and the coordinates of the panel elements where this pressure is
calculated. Let’s test it out:

In [8]: [cl, cp, xc] = vortex_panel(points, -5, 1)


print(cl)
savefig('cp.png')

0.297296594929

1.3 Parametric aerofoil simulation


We have shown how to create a Bezier spline aerfoil with all control point weights,
(0,1,2,3) (0,1,2,3)
(zu , zl = 1). You create a function to do this in Lab 2. Now we’ll make this aerofoil
(2)
defintion ’parametric’ by varying (w = zu ): zp = np.array([1, 1, 1, 1]) zq = np.array([1, 1, w, 1])
You’re going to create a function (parametric_aerofoil(w,file_path)) in Lab 3, and we’ll import
this module now:

In [9]: from aclab3 import parametric_aerofoil

8
By setting (w = 1) we get the same aerofoil as before:

In [10]: w = 5
parametric_aerofoil(w)

Out[10]: array([[ 1.00000000e+00, 0.00000000e+00],


[ 9.85000500e-01, 2.33741500e-03],
[ 9.70004000e-01, 4.55132000e-03],
[ 9.55013500e-01, 6.64420500e-03],
[ 9.40032000e-01, 8.61856000e-03],
[ 9.25062500e-01, 1.04768750e-02],
[ 9.10108000e-01, 1.22216400e-02],
[ 8.95171500e-01, 1.38553450e-02],
[ 8.80256000e-01, 1.53804800e-02],
[ 8.65364500e-01, 1.67995350e-02],
[ 8.50500000e-01, 1.81150000e-02],
[ 8.35665500e-01, 1.93293650e-02],
[ 8.20864000e-01, 2.04451200e-02],
[ 8.06098500e-01, 2.14647550e-02],
[ 7.91372000e-01, 2.23907600e-02],
[ 7.76687500e-01, 2.32256250e-02],
[ 7.62048000e-01, 2.39718400e-02],
[ 7.47456500e-01, 2.46318950e-02],
[ 7.32916000e-01, 2.52082800e-02],
[ 7.18429500e-01, 2.57034850e-02],
[ 7.04000000e-01, 2.61200000e-02],
[ 6.89630500e-01, 2.64603150e-02],
[ 6.75324000e-01, 2.67269200e-02],
[ 6.61083500e-01, 2.69223050e-02],
[ 6.46912000e-01, 2.70489600e-02],
[ 6.32812500e-01, 2.71093750e-02],
[ 6.18788000e-01, 2.71060400e-02],
[ 6.04841500e-01, 2.70414450e-02],
[ 5.90976000e-01, 2.69180800e-02],
[ 5.77194500e-01, 2.67384350e-02],
[ 5.63500000e-01, 2.65050000e-02],
[ 5.49895500e-01, 2.62202650e-02],
[ 5.36384000e-01, 2.58867200e-02],
[ 5.22968500e-01, 2.55068550e-02],
[ 5.09652000e-01, 2.50831600e-02],
[ 4.96437500e-01, 2.46181250e-02],
[ 4.83328000e-01, 2.41142400e-02],
[ 4.70326500e-01, 2.35739950e-02],
[ 4.57436000e-01, 2.29998800e-02],
[ 4.44659500e-01, 2.23943850e-02],
[ 4.32000000e-01, 2.17600000e-02],
[ 4.19460500e-01, 2.10992150e-02],
[ 4.07044000e-01, 2.04145200e-02],

9
[ 3.94753500e-01, 1.97084050e-02],
[ 3.82592000e-01, 1.89833600e-02],
[ 3.70562500e-01, 1.82418750e-02],
[ 3.58668000e-01, 1.74864400e-02],
[ 3.46911500e-01, 1.67195450e-02],
[ 3.35296000e-01, 1.59436800e-02],
[ 3.23824500e-01, 1.51613350e-02],
[ 3.12500000e-01, 1.43750000e-02],
[ 3.01325500e-01, 1.35871650e-02],
[ 2.90304000e-01, 1.28003200e-02],
[ 2.79438500e-01, 1.20169550e-02],
[ 2.68732000e-01, 1.12395600e-02],
[ 2.58187500e-01, 1.04706250e-02],
[ 2.47808000e-01, 9.71264000e-03],
[ 2.37596500e-01, 8.96809500e-03],
[ 2.27556000e-01, 8.23948000e-03],
[ 2.17689500e-01, 7.52928500e-03],
[ 2.08000000e-01, 6.84000000e-03],
[ 1.98490500e-01, 6.17411500e-03],
[ 1.89164000e-01, 5.53412000e-03],
[ 1.80023500e-01, 4.92250500e-03],
[ 1.71072000e-01, 4.34176000e-03],
[ 1.62312500e-01, 3.79437500e-03],
[ 1.53748000e-01, 3.28284000e-03],
[ 1.45381500e-01, 2.80964500e-03],
[ 1.37216000e-01, 2.37728000e-03],
[ 1.29254500e-01, 1.98823500e-03],
[ 1.21500000e-01, 1.64500000e-03],
[ 1.13955500e-01, 1.35006500e-03],
[ 1.06624000e-01, 1.10592000e-03],
[ 9.95085000e-02, 9.15055000e-04],
[ 9.26120000e-02, 7.79960000e-04],
[ 8.59375000e-02, 7.03125000e-04],
[ 7.94880000e-02, 6.87040000e-04],
[ 7.32665000e-02, 7.34195000e-04],
[ 6.72760000e-02, 8.47080000e-04],
[ 6.15195000e-02, 1.02818500e-03],
[ 5.60000000e-02, 1.28000000e-03],
[ 5.07205000e-02, 1.60501500e-03],
[ 4.56840000e-02, 2.00572000e-03],
[ 4.08935000e-02, 2.48460500e-03],
[ 3.63520000e-02, 3.04416000e-03],
[ 3.20625000e-02, 3.68687500e-03],
[ 2.80280000e-02, 4.41524000e-03],
[ 2.42515000e-02, 5.23174500e-03],
[ 2.07360000e-02, 6.13888000e-03],
[ 1.74845000e-02, 7.13913500e-03],
[ 1.45000000e-02, 8.23500000e-03],

10
[ 1.17855000e-02, 9.42896500e-03],
[ 9.34400000e-03, 1.07235200e-02],
[ 7.17850000e-03, 1.21211550e-02],
[ 5.29200000e-03, 1.36243600e-02],
[ 3.68750000e-03, 1.52356250e-02],
[ 2.36800000e-03, 1.69574400e-02],
[ 1.33650000e-03, 1.87922950e-02],
[ 5.96000000e-04, 2.07426800e-02],
[ 1.49500000e-04, 2.28110850e-02],
[ 0.00000000e+00, 2.50000000e-02],
[ 5.94293979e-04, 2.74621500e-02],
[ 2.34895054e-03, 3.03255486e-02],
[ 5.21041569e-03, 3.35524297e-02],
[ 9.11204675e-03, 3.71017407e-02],
[ 1.39766650e-02, 4.09303597e-02],
[ 1.97192411e-02, 4.49942726e-02],
[ 2.62495686e-02, 4.92496568e-02],
[ 3.34748042e-02, 5.36538347e-02],
[ 4.13017754e-02, 5.81660698e-02],
[ 4.96389892e-02, 6.27481949e-02],
[ 5.83983040e-02, 6.73650715e-02],
[ 6.74962502e-02, 7.19848897e-02],
[ 7.68550095e-02, 7.65793252e-02],
[ 8.64030768e-02, 8.11235727e-02],
[ 9.60756405e-02, 8.55962790e-02],
[ 1.05814722e-01, 8.99793967e-02],
[ 1.15569122e-01, 9.42579808e-02],
[ 1.25294203e-01, 9.84199464e-02],
[ 1.34951573e-01, 1.02455803e-01],
[ 1.44508671e-01, 1.06358382e-01],
[ 1.53938316e-01, 1.10122558e-01],
[ 1.63218226e-01, 1.13744990e-01],
[ 1.72330527e-01, 1.17223867e-01],
[ 1.81261276e-01, 1.20558679e-01],
[ 1.90000000e-01, 1.23750000e-01],
[ 1.98539263e-01, 1.26799301e-01],
[ 2.06874266e-01, 1.29708780e-01],
[ 2.15002480e-01, 1.32481209e-01],
[ 2.22923313e-01, 1.35119808e-01],
[ 2.30637813e-01, 1.37628132e-01],
[ 2.38148407e-01, 1.40009971e-01],
[ 2.45458666e-01, 1.42269272e-01],
[ 2.52573104e-01, 1.44410071e-01],
[ 2.59497001e-01, 1.46436432e-01],
[ 2.66236257e-01, 1.48352403e-01],
[ 2.72797254e-01, 1.50161978e-01],
[ 2.79186757e-01, 1.51869063e-01],
[ 2.85411814e-01, 1.53477450e-01],

11
[ 2.91479683e-01, 1.54990804e-01],
[ 2.97397770e-01, 1.56412639e-01],
[ 3.03173575e-01, 1.57746314e-01],
[ 3.08814657e-01, 1.58995019e-01],
[ 3.14328596e-01, 1.60161771e-01],
[ 3.19722972e-01, 1.61249409e-01],
[ 3.25005350e-01, 1.62260593e-01],
[ 3.30183268e-01, 1.63197800e-01],
[ 3.35264233e-01, 1.64063324e-01],
[ 3.40255717e-01, 1.64859277e-01],
[ 3.45165165e-01, 1.65587587e-01],
[ 3.50000000e-01, 1.66250000e-01],
[ 3.54767635e-01, 1.66848077e-01],
[ 3.59475489e-01, 1.67383199e-01],
[ 3.64130998e-01, 1.67856558e-01],
[ 3.68741646e-01, 1.68269166e-01],
[ 3.73314980e-01, 1.68621844e-01],
[ 3.77858640e-01, 1.68915223e-01],
[ 3.82380392e-01, 1.69149741e-01],
[ 3.86888155e-01, 1.69325635e-01],
[ 3.91390049e-01, 1.69442938e-01],
[ 3.95894428e-01, 1.69501466e-01],
[ 4.00409932e-01, 1.69500813e-01],
[ 4.04945540e-01, 1.69440336e-01],
[ 4.09510628e-01, 1.69319140e-01],
[ 4.14115037e-01, 1.69136066e-01],
[ 4.18769148e-01, 1.68889665e-01],
[ 4.23483967e-01, 1.68578175e-01],
[ 4.28271226e-01, 1.68199497e-01],
[ 4.33143490e-01, 1.67751159e-01],
[ 4.38114289e-01, 1.67230274e-01],
[ 4.43198263e-01, 1.66633502e-01],
[ 4.48411338e-01, 1.65956989e-01],
[ 4.53770920e-01, 1.65196307e-01],
[ 4.59296133e-01, 1.64346377e-01],
[ 4.65008093e-01, 1.63401381e-01],
[ 4.70930233e-01, 1.62354651e-01],
[ 4.77088690e-01, 1.61198549e-01],
[ 4.83512770e-01, 1.59924304e-01],
[ 4.90235502e-01, 1.58521834e-01],
[ 4.97294316e-01, 1.56979516e-01],
[ 5.04731861e-01, 1.55283912e-01],
[ 5.12597019e-01, 1.53419427e-01],
[ 5.20946149e-01, 1.51367893e-01],
[ 5.29844647e-01, 1.49108043e-01],
[ 5.39368902e-01, 1.46614845e-01],
[ 5.49608781e-01, 1.43858672e-01],
[ 5.60670814e-01, 1.40804217e-01],

12
[ 5.72682326e-01, 1.37409103e-01],
[ 5.85796847e-01, 1.33622046e-01],
[ 6.00201313e-01, 1.29380425e-01],
[ 6.16125761e-01, 1.24606998e-01],
[ 6.33856609e-01, 1.19205407e-01],
[ 6.53755164e-01, 1.13053918e-01],
[ 6.76283915e-01, 1.05996513e-01],
[ 7.02044748e-01, 9.78299613e-02],
[ 7.31835874e-01, 8.82845443e-02],
[ 7.66739140e-01, 7.69944979e-02],
[ 8.08258461e-01, 6.34511483e-02],
[ 8.58548098e-01, 4.69256300e-02],
[ 9.20807042e-01, 2.63353695e-02],
[ 1.00000000e+00, 0.00000000e+00]])

but we can now produce a range of shapes. For example, create a range of (w) values:

In [11]: w = linspace(0.5, 1.5, 11)


print(w)

[ 0.5 0.6 0.7 0.8 0.9 1. 1.1 1.2 1.3 1.4 1.5]

and loop through these, calling (parametric_aerofoil):

In [12]: for i in range(0, 11):


parametric_aerofoil(w[i])

13
Naturally aerofoils with different control point weightings can be simulated using vor-
tex_panel. This is useful if we, for example, wanted to carry out a methodical sweep of the
(2)
performance of aerofoils with, e.g. (zu = 0.5, ..., 11.5). First initialise the an array of (cl) val-
ues, and then loop through our array of (w) values and, calculating the aerofoil surface points, and
calling vortex_panel:

In [13]: from aclabtools import vortex_panel


cl = np.zeros(len(w))
for i in range(0, len(w)):
points = parametric_aerofoil(w[i])
[cl[i], cp, xc] = vortex_panel(points, 0.0, 1)
print(cl)

[ 0.7993697 0.82399553 0.84561011 0.86402808 0.87865773 0.8911768


0.90256408 0.91328471 0.92311583 0.93128232 0.93746453]

14
We can plot these:

In [14]: pl.plot(w, cl, 'ko');

15
(2)
The relationship between (zu ) and (CL ) may well not be linear so, instead of the first or-
der polynomial you used in the last lab, we’ll use a ’moving least squares’ fit. The function
mls_curve_fit accepts three inputs: an array of (x) and (y) values to fit, and an (x)-value at which
to make a prediction. It plots the input data, the curve fit, and returns the prediction. Below we’ll
fit the data you calculated above:

In [15]: from aclabtools import mls_curve_fit


mls_curve_fit(w,cl,0.75)

Out[15]: 0.85525561957972285

16

Вам также может понравиться