Cosine Spacing

26
 KIVANÇ ALİ ANIL April 17, 2007 508052003 COSINE SPACING -c/2 ---- c/2 0 ---- c ( ) cos 2 c  x =    ( ) sin 2 c dx x dx =    ( ) ( ) 1 cos 2 c  x x =    ( ) sin 2 c dx x dx =    Vortex weight factor n dx  x x dx δ δ  =    ( ) sin 2 n c  x x  N π δ   =    ( ) 2 sin 2 n c  x x  N π δ   =    ( ) 2 1 cos 2 n c  x x  N π δ   =    ( ) cos 2 c  x =    ( ) 2 cos  x x c =    ( ) 2 cos  x c =  2 2 1 2 n c  x x c N π δ    =  2 2 4 1 2 n c  x x c N π δ   =  2 2 4 n c  x x  N π δ   =  Vortex weight factor n dx  x x dx δ δ  =    ( ) sin 2 n c  x x  N π δ   =    ( ) 2 sin 2 n c  x x  N π δ   =    ( ) 2 1 cos 2 n c  x x  N π δ   =    ( ) ( ) 1 cos 2 c  x x =    ( ) 2 1 cos  x c =    ( ) 2 cos 1  x c =  2 2 1 1 2 n c  x x c N π δ    =  2 2 4 4 1 1 2 n c  x x x c c N π δ    = +  2 2 4 4 1 1 2 n c  x x x c c N π δ   = +  ( ) 2 2 4 2 n c  x cx x c N π δ   =  ( ) 2 2 4 2 n c  x cx x c N π δ   =  ( ) n  x c x  x  N π δ  =  (Equation 72, Justin E. Kerwin)

description

Cosine Spacing

Transcript of Cosine Spacing

Page 1: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 1/26

KIVANÇ ALİ ANIL April 17, 2007508052003

COSINE SPACING

-c/2 ---- c/2 0 ---- c

( )cos2

c x= −  

( )sin2

cdx x dx=  

( )( )1 cos2

c x x= −  

( )sin2

cdx x dx=  

Vortex weight factor 

n

dx x x

dxδ δ  =

 

( )sin2

n

c x x

 N 

π δ   =  

( )2sin2

n

c x x

 N 

π δ   =  

( )21 cos2

n

c x x

 N 

π δ   = −  

( )cos2

c x= −  

( )2

cos x xc

= −  

( )2

cos xc

= −  

22

12

n

c x x

c N 

π δ  

= − −

 

2

2

41

2n

c x x

c N 

π δ   = −  

22

4n

c x x

 N 

π δ   = −  

Vortex weight factor 

n

dx x x

dxδ δ  =

 

( )sin2

n

c x x

 N 

π δ   =  

( )2sin2

n

c x x

 N 

π δ   =  

( )21 cos2

n

c x x

 N 

π δ   = −  

( )( )1 cos2

c x x= −  

( )2

1 cos xc

= −  

( )2

cos 1 xc

= −  

22

1 12

n

c x x

c N 

π δ  

= − −

 

2

2

4 41 1

2n

c  x x x

c c N 

π δ  

= − − +

 

2

2

4 41 1

2n

c  x x x

c c N 

π δ   = − + −  

( )2

2

4

2n

c

  x cx xc N 

π δ  

= −  

( )2

2

4

2n

c  x cx x

c N 

π δ   = −  

( )n

 x c x x

 N 

π δ  

−=  

(Equation 72, Justin E. Kerwin)

Page 2: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 2/26

KIVANÇ ALİ ANIL April 17, 2007508052003

-c/2 ---- c/2 0 ---- c

The equation of a parabolic mean line with

maximum camber  0 f  is

( )2

021 x  f x f  c

= −

 

The equation of a parabolic mean line with

maximum camber  0 f  is

( )

2

0

22

1

c x

  f x f  c

− = −

 

( )2

0

21

x c  f x f  

c

− = −

 

( )2

0

21 1

 x  f x f  

c

= − −

 

( )2

0 2

4 41 1

 x x  f x f  

c c

= − − +

 

( )2

0 2

4 4 x x  f x f  

c c

= −

 

( ) 0

41

x  f x f  

c c

= −

 

(Equation 5.80, Katz&Plotkin)The Slope is:

0

2

8df f x

dx c= −  

The Slope is:

0 2

4 8df x f 

dx c c

= −

 

0 24 1

df f x

dx c c

= −

 

(Equation 5.81, Katz&Plotkin)

We can see from the following figures that both formulations for cosine spacing give thesame results.

Page 3: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 3/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 1.  Input Window for The Parabolic Mean Line (Cosine Spacing -c/2 - c/2). 

Figure 2.  Input Window for The flow angle of attack (alpha in degrees) - Thedefault value is for CL = 1.

Figure 3.  The Geometry & Results.

Page 4: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 4/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 4.  Input Window for The Parabolic Mean Line (Cosine Spacing 0 - c). 

Figure 5.  Input Window for The flow angle of attack (alpha in degrees) - Thedefault value is for CL = 1.

Figure 6.  The Geometry & Results.

Page 5: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 5/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 7.  Input Window for The Parabolic Mean Line (Cosine Spacing 0- c). 

Figure 8.  Input Window for The flow angle of attack (alpha in degrees) - The

default value is for CL = 1.

Figure 9.  The Geometry & Results.

Page 6: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 6/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 10. The Geometry & Results.

Figure 11. The Geometry & Results.

Page 7: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 7/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 12.  Input Window for The Parabolic Mean Line (Cosine Spacing -c/2 - c/2). 

Figure 13.  Input Window for The flow angle of attack (alpha in degrees) - The

default value is for CL = 1.

Figure 14. The Geometry & Results.

Page 8: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 8/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 15.  Input Window for The Parabolic Mean Line (Cosine Spacing 0 - c). 

Figure 16.  Input Window for The flow angle of attack (alpha in degrees) - The

default value is for CL = 1.

Figure 17. The Geometry & Results.

Page 9: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 9/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 18.  Input Window for The Parabolic Mean Line (Cosine Spacing 0- c). 

Figure 19.  Input Window for The flow angle of attack (alpha in degrees) - Thedefault value is for CL = 1.

Figure 20. The Geometry & Results.

Page 10: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 10/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 21. The Geometry & Results.

Figure 22. The Geometry & Results.

Page 11: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 11/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 23.  Input Window for The FLAT PLATE (Cosine Spacing -c/2 - c/2). 

Figure 24.  Input Window for The flow angle of attack (alpha in degrees) - Thedefault value is for CL = 1.

Figure 25. The Geometry & Results.

Page 12: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 12/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 26.  Input Window for The FLAT PLATE (Cosine Spacing -c/2 - c/2). 

Figure 27.  Input Window for The flow angle of attack (alpha in degrees) - The

default value is for CL = 1.

Figure 28. The Geometry & Results.

Page 13: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 13/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 29.  Input Window for The FLAT PLATE (Cosine Spacing 0 - c). 

Figure 30.  Input Window for The flow angle of attack (alpha in degrees) - The

default value is for CL = 1.

Figure 31. The Geometry & Results.

Page 14: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 14/26

KIVANÇ ALİ ANIL April 17, 2007508052003

2-D Vortex Lattice Method with Cosine Spacing

(13.04 LECTURE NOTES HYDROFOILS AND PROPELLERS, Justin E. Kerwin)

pages 53-54

We first define an auxiliary angular variable  x such that

( )( )1 cos2

c x x= − (69)

so that 0 x = corresponds to the leading edge and  x π = corresponds to the trailing edge

 x c= . This is the same as the change of variables introduced by Glauert, except that the x

coordinate has been shifted by c/2 to place the leading edge at 0 x = . We next divide the

chord into N equal intervals of  x  with common interval N δ π = . Point vortices nΓ are

located at the mid-points of each  x  interval, and control points are located at the

downstream boundary of each  x  interval,

(70)

( ) 1 cos2

c

c n x n

 N 

π  = −

 

 Note that with this spacing algorithm the last control point is at the trailing edge, c= .

The velocity induced at the n’th control point is simply, 

(71) 

where the last equality in 71 is a statement of the boundary condition developed earlier.

Equation 71, written for each of the  N  control points, represents a set of simultaneous

equations for the unknown point vortex strengths nΓ .

( )( )1/ 2

1 cos2

v

nc x n

 N 

π  − = −

( ) ( )1

1

2

 N m

n

m v c

df v U 

  x m x m dxα 

π  =

Γ = − = − −

Page 15: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 15/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 32.  Input Window for VLM-2D for The Parabolic Mean Line

Figure 33.  Input Window for The flow angle of attack (alpha in degrees) - The

default value is for CL = 1.

Figure 34. The Geometry & Results (VLM-2D for The Parabolic Mean Line)

Page 16: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 16/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 35. The Geometry & Results (VLM-2D for The Parabolic Mean Line)

Page 17: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 17/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 36.  Input Window for VLM-2D for The Parabolic Mean Line

Figure 37.  Input Window for The flow angle of attack (alpha in degrees) - The

default value is for CL = 1.

Figure 38. The Geometry & Results (VLM-2D for The Parabolic Mean Line)

Page 18: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 18/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 39. The Geometry & Results (VLM-2D for The Parabolic Mean Line)

Page 19: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 19/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 40.  Input Window for VLM-2D for The FLAT PLATE

Figure 41.  Input Window for The flow angle of attack (alpha in degrees) - The

default value is for CL = 1.

Figure 42. The Geometry & Results (VLM-2D for The FLAT PLATE)

Page 20: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 20/26

KIVANÇ ALİ ANIL April 17, 2007508052003

Figure 43. The Geometry & Results (VLM-2D for The FLAT PLATE)

Page 21: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 21/26

C:\Documents and Settings\xp\My Documents\ZOVAN...\parabolic1.m PageApril 15, 2007 10:06:38

% Kivanc Ali ANIL (2007)

% 508052003%

% The Parabolic Mean Line% Cosine Spacing% -c/2 - c/2

clc, clear, close all,format compact

% ---------------------------------------------def0 = {'1','0.4','8','1'};

dlgTitle = 'The Parabolic Mean Line (Cosine Spacing -c/2 - c/2)';prompt = {'Chord Length (c)',...

'Maximum Chamber (fo) ',...

'Number of Panels (N)',...'Free stream velocity (U)'};

data = inputdlg(prompt,dlgTitle,1,def0);if isempty(data)==1

clearreturn

endc = str2num(char(data(1)));f0 = str2num(char(data(2)));

N = str2num(char(data(3)));U = str2num(char(data(4)));

defalpha = ((1-4*pi*f0/c)/(2*pi))*180/pi;def1 = {num2str(defalpha)};prompt = {'The flow angle of attack (alpha in degrees) - The default value is fo

CL = 1'};data = inputdlg(prompt,dlgTitle,1,def1);

if isempty(data)==1clear

return

endalpha = str2num(char(data(1)))*pi/180;% ---------------------------------------------% Exact solution

xtilda = 0:pi/36:pi;x = -(c/2)*cos(xtilda); % -c/2 - c/2

f = f0*(1-(2*x/c).^2); % -c/2 - c/2CL = 2*pi*alpha+4*pi*f0/c;

gamma = (-2*U*alpha*(1+cos(xtilda))./sin(xtilda))-8*U*sin(xtilda)*f0/c;warning off MATLAB:divideByZero% ---------------------------------------------

% The global coordinates for panelsGCO = [ ];

for k = 1:N+1xgc = -(c/2)*cos((k-1)*pi/N); % -c/2 - c/2

GCO = [GCO; xgc f0*(1-(2*xgc/c)^2)]; % -c/2 - c/2end% ---------------------------------------------

GVP = [ ]; % The global lump vortex points of the panelsGCP = [ ]; % The global collocation points of the panels

for k = 1:Ncp(k) = ((GCO(k,1)-GCO(k+1,1))^2+(GCO(k,2)-GCO(k+1,2))^2)^.5;

theta(k)= atan((GCO(k,2)-GCO(k+1,2))/(GCO(k,1)-GCO(k+1,1)));xgvp = GCO(k,1)+(cp(k)/4)*cos(theta(k));ygvp = GCO(k,2)+(cp(k)/4)*sin(theta(k));

Page 22: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 22/26

C:\Documents and Settings\xp\My Documents\ZOVAN...\parabolic1.m PageApril 15, 2007 10:06:38

GVP = [GVP; xgvp ygvp];

xgcp = GCO(k,1)+(3*cp(k)/4)*cos(theta(k));ygcp = GCO(k,2)+(3*cp(k)/4)*sin(theta(k));

GCP = [GCP; xgcp ygcp];dx(k) = sqrt((c^2/4)-GVP(k,1)^2)*pi/N; % Vortex weight factors -c/2 - c/2

end

% ---------------------------------------------for i = 1:N

for j = 1:Nr(i,j) = ((GVP(j,1)-GCP(i,1))^2+(GVP(j,2)-GCP(i,2))^2)^.5;

beta(i,j) = theta(i)- atan((GVP(j,2)-GCP(i,2))/(GVP(j,1)-GCP(i,1)));A(i,j) = (1/(2*pi*r(i,j)))*cos(beta(i,j));if j > i

A(i,j) = -A(i,j);end

endend

% [A] {X} = {b}b = -(U*(alpha-theta)); %sin(alpha-theta) = (alpha-theta) since (alpha-theta) is

allb = b'; % TransposeX = A\b;

Xplot = X./dx';%-U*c*pi*alpha % Lumped Vortex Element for Flat plate (f0 = 0, N = 1)

% ---------------------------------------------figure(1)subplot(2,1,1),plot(x,f,'k')

hold onplot(GCO(:,1),GCO(:,2),'r','linewidth',2)

plot(GCO(:,1),GCO(:,2),'g+','linewidth',2)plot(GVP(:,1),GVP(:,2),'o','linewidth',2)

plot(GCP(:,1),GCP(:,2),'x','linewidth',2)

axis equaltitle(['\fontsize{20}\bf{GEOMETRY}']);

grid% ---------------------------------------------

subplot(2,1,2),plot(x(2:length(x)),gamma(2:length(x)),'linewidth',2)hold on

plot(GVP(:,1),Xplot,'or','linewidth',2)legend('\fontsize{15}\bf{Exact Solution}',[num2str(N) , ' Panels'])

xlabel('\fontsize{15}\bf{x}');ylabel('\fontsize{15}\bf{\gamma (x)}');set(figure(1),'Position',[1,1,1400,930])

title(['\fontsize{20}\bf{\gamma (x) (for C_L = }',num2str(CL),')']);grid

% ---------------------------------------------

Page 23: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 23/26

C:\Documents and Settings\xp\My Documents\ZOVAN...\parabolic2.m PageApril 15, 2007 10:10:34

% Kivanc Ali ANIL (2007)

% 508052003%

% The Parabolic Mean Line% Cosine Spacing% 0 - c

clc, clear, close all,format compact

% ---------------------------------------------def0 = {'1','0.4','8','1'};

dlgTitle = 'The Parabolic Mean Line (Cosine Spacing 0 - c)';prompt = {'Chord Length (c)',...

'Maximum Chamber (fo) ',...

'Number of Panels (N)',...'Free stream velocity (U)'};

data = inputdlg(prompt,dlgTitle,1,def0);if isempty(data)==1

clearreturn

endc = str2num(char(data(1)));f0 = str2num(char(data(2)));

N = str2num(char(data(3)));U = str2num(char(data(4)));

defalpha = ((1-4*pi*f0/c)/(2*pi))*180/pi;def1 = {num2str(defalpha)};prompt = {'The flow angle of attack (alpha in degrees) - The default value is fo

CL = 1'};data = inputdlg(prompt,dlgTitle,1,def1);

if isempty(data)==1clear

return

endalpha = str2num(char(data(1)))*pi/180;% ---------------------------------------------% Exact solution

xtilda = 0:pi/36:pi;x = (c/2)*(1-cos(xtilda)); % 0 - c

f = f0*(1-(2*(x-c/2)/c).^2); % 0 - cCL = 2*pi*alpha+4*pi*f0/c;

gamma = (-2*U*alpha*(1+cos(xtilda))./sin(xtilda))-8*U*sin(xtilda)*f0/c;warning off MATLAB:divideByZero% ---------------------------------------------

% The global coordinates for panelsGCO = [ ];

for k = 1:N+1xgc = (c/2)*(1-cos((k-1)*pi/N)); % 0 - c

GCO = [GCO; xgc f0*(1-(2*(xgc-c/2)/c)^2)]; % 0 - cend% ---------------------------------------------

GVP = [ ]; % The global lump vortex points of the panelsGCP = [ ]; % The global collocation points of the panels

for k = 1:Ncp(k) = ((GCO(k,1)-GCO(k+1,1))^2+(GCO(k,2)-GCO(k+1,2))^2)^.5;

theta(k)= atan((GCO(k,2)-GCO(k+1,2))/(GCO(k,1)-GCO(k+1,1)));xgvp = GCO(k,1)+(cp(k)/4)*cos(theta(k));ygvp = GCO(k,2)+(cp(k)/4)*sin(theta(k));

Page 24: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 24/26

C:\Documents and Settings\xp\My Documents\ZOVAN...\parabolic2.m PageApril 15, 2007 10:10:34

GVP = [GVP; xgvp ygvp];

xgcp = GCO(k,1)+(3*cp(k)/4)*cos(theta(k));ygcp = GCO(k,2)+(3*cp(k)/4)*sin(theta(k));

GCP = [GCP; xgcp ygcp];dx(k) = sqrt((c-GVP(k,1))*GVP(k,1))*pi/N;% Vortex weight factors 0 - c

end

% ---------------------------------------------for i = 1:N

for j = 1:Nr(i,j) = ((GVP(j,1)-GCP(i,1))^2+(GVP(j,2)-GCP(i,2))^2)^.5;

beta(i,j) = theta(i)- atan((GVP(j,2)-GCP(i,2))/(GVP(j,1)-GCP(i,1)));A(i,j) = (1/(2*pi*r(i,j)))*cos(beta(i,j));if j > i

A(i,j) = -A(i,j);end

endend

% [A] {X} = {b}b = -(U*(alpha-theta)); %sin(alpha-theta) = (alpha-theta) since (alpha-theta) is

allb = b'; % TransposeX = A\b;

Xplot = X./dx';%-U*c*pi*alpha % Lumped Vortex Element for Flat plate (f0 = 0, N = 1)

% ---------------------------------------------figure(1)subplot(2,1,1),plot(x,f,'k')

hold onplot(GCO(:,1),GCO(:,2),'r','linewidth',2)

plot(GCO(:,1),GCO(:,2),'g+','linewidth',2)plot(GVP(:,1),GVP(:,2),'o','linewidth',2)

plot(GCP(:,1),GCP(:,2),'x','linewidth',2)

axis equaltitle(['\fontsize{20}\bf{GEOMETRY}']);

grid% ---------------------------------------------

subplot(2,1,2),plot(x(2:length(x)),gamma(2:length(x)),'linewidth',2)hold on

plot(GVP(:,1),Xplot,'or','linewidth',2)legend('\fontsize{15}\bf{Exact Solution}',[num2str(N) , ' Panels'])

xlabel('\fontsize{15}\bf{x}');ylabel('\fontsize{15}\bf{\gamma (x)}');set(figure(1),'Position',[1,1,1400,930])

title(['\fontsize{20}\bf{\gamma (x) (for C_L = }',num2str(CL),')']);grid

% ---------------------------------------------

Page 25: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 25/26

C:\Documents and Settings\xp\My Documents\ZOVANC\Tur...\VLM2D.m PageApril 15, 2007 10:11:19

% Kivanc Ali ANIL (2007)

% 508052003%

% VLM-2D for The Parabolic Mean Line% Cosine Spacing% 0 - c

clc, clear, close all,format compact

% ---------------------------------------------def0 = {'1','0.4','8','1'};

dlgTitle = 'VLM-2D for The Parabolic Mean Line';prompt = {'Chord Length (c)',...

'Maximum Chamber (fo) ',...

'Number of Panels (N)',...'Free stream velocity (U)'};

data = inputdlg(prompt,dlgTitle,1,def0);if isempty(data)==1

clearreturn

endc = str2num(char(data(1)));f0 = str2num(char(data(2)));

N = str2num(char(data(3)));U = str2num(char(data(4)));

defalpha = ((1-4*pi*f0/c)/(2*pi))*180/pi;def1 = {num2str(defalpha)};prompt = {'The flow angle of attack (alpha in degrees) - The default value is fo

CL = 1'};data = inputdlg(prompt,dlgTitle,1,def1);

if isempty(data)==1clear

return

endalpha = str2num(char(data(1)))*pi/180;% ---------------------------------------------% Exact solution

xtilda = 0:pi/36:pi;x = (c/2)*(1-cos(xtilda)); % 0 - c

f = f0*(1-(2*(x-c/2)/c).^2);

CL = 2*pi*alpha+4*pi*f0/c;gamma = (-2*U*alpha*(1+cos(xtilda))./sin(xtilda))-8*U*sin(xtilda)*f0/c;warning off MATLAB:divideByZero

% ---------------------------------------------% The global coordinates for panels

GCO = [ ];for k = 1:N+1

xgc = (c/2)*(1-cos((k-1)*pi/N));GCO = [GCO; xgc 0];

end

% ---------------------------------------------GVP = [ ]; % The global lump vortex points of the panels

GCP = [ ]; % The global collocation points of the panelsfor k = 1:N

xgvp = (c/2)*(1-cos((k-1/2)*pi/N));GVP = [GVP; xgvp 0];xgcp = (c/2)*(1-cos(k*pi/N));

Page 26: Cosine Spacing

5/14/2018 Cosine Spacing - slidepdf.com

http://slidepdf.com/reader/full/cosine-spacing 26/26

C:\Documents and Settings\xp\My Documents\ZOVANC\Tur...\VLM2D.m PageApril 15, 2007 10:11:19

GCP = [GCP; xgcp 0];

dx(k) = sqrt((c-GVP(k,1))*GVP(k,1))*pi/N;% Vortex weight factorsend

% ---------------------------------------------% Solution of Equation 71 for the Parabolic Mean Line% (13.04 LECTURE NOTES HYDROFOILS AND PROPELLERS, Justin E. Kerwin)

for i = 1:Nb(i,1) = U*((4*f0*(1-2*GCP(i,1)/c)/c)-alpha); %sin(alpha) = (alpha) since (alpha)

smallfor j = 1:N

r(i,j) = GVP(j,1)-GCP(i,1);A(i,j) = -(1/(2*pi*r(i,j)));

end

end% [A] {X} = {b}

X = A\b;Xplot = X./dx';

% ---------------------------------------------figure(1)

subplot(2,1,1),plot(x,f,'k')hold onplot(GCO(:,1),GCO(:,2),'r','linewidth',2)

plot(GCO(:,1),GCO(:,2),'g+','linewidth',2)plot(GVP(:,1),GVP(:,2),'o','linewidth',2)

plot(GCP(:,1),GCP(:,2),'x','linewidth',2)axis equaltitle(['\fontsize{20}\bf{GEOMETRY}']);

grid% ---------------------------------------------

subplot(2,1,2),plot(x(2:length(x)),gamma(2:length(x)),'linewidth',2)hold on

plot(GVP(:,1),Xplot,'or','linewidth',2)

legend('\fontsize{15}\bf{Exact Solution}',[num2str(N) , ' Panels'])xlabel('\fontsize{15}\bf{x}');

ylabel('\fontsize{15}\bf{\gamma (x)}');set(figure(1),'Position',[1,1,1400,930])

title(['\fontsize{20}\bf{\gamma (x) (for C_L = }',num2str(CL),')']);grid

% ---------------------------------------------