0% found this document useful (0 votes)
501 views20 pages

Modelling The Flow Via 2D Constant Source Panel Method

The document describes applying a 2D constant strength source panel method to model flow around symmetric objects like a circle and NACA foil. It uses Matlab code to calculate panel coordinates, angles, source strengths (lambdas), velocities and pressures. For the circle, it tests varying the number of panels from 8 to 20 and collocation point location from 0.25 to 0.5 of panel length. More panels and collocation points at 0.25 provide better results compared to analytical solutions, though errors still exist. The method is not fully suitable to model this problem accurately.

Uploaded by

emre6135
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
501 views20 pages

Modelling The Flow Via 2D Constant Source Panel Method

The document describes applying a 2D constant strength source panel method to model flow around symmetric objects like a circle and NACA foil. It uses Matlab code to calculate panel coordinates, angles, source strengths (lambdas), velocities and pressures. For the circle, it tests varying the number of panels from 8 to 20 and collocation point location from 0.25 to 0.5 of panel length. More panels and collocation points at 0.25 provide better results compared to analytical solutions, though errors still exist. The method is not fully suitable to model this problem accurately.

Uploaded by

emre6135
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 20

I tried to model the flow around symmetric objects via the 2D constant strength source panel

method. I used a circle and a naca foil. All calculations were carried out on Matlab and all codes are
given below this paragraph.
Number of panels were chosen as 8 and 20 for circle and 10 and 20 for the naca profile and the
collocation points were chosen at the half and the quarter of the panels lengths.
Uinf=0
R=1
The program reads the panel coordinates from the excel sheet and then continues the calculation.

THE CODE :
clc;
close all;
clear all
R=1;
u=1;
filename='koordinatlar';
zz=xlsread(filename); %koordinatlar girildi
n=length(zz(:,1))-1;
Y=zz(:,2);
X=zz(:,1); %koordinatlar blnd
subplot(3,1,1)
axis square;
hold on; grid on;
ezplot('x^2+y^2-1');
title(['Daire zerinde Panel Yerleimi( ' num2str(n),' PANEL,
R=',num2str(R),' m ,U_G= ',num2str(u) ' m/s)'])
%%

alarn bulunmas

for i=1:n
teta(i,:)=atan2(Y(i+1,:)-Y(i,:),X(i+1,:)-X(i,:));
if teta(i,:)<0;
teta(i,:)=teta(i,:)+2*pi();
elseif teta(i,:)>2*pi
teta(i,:)=teta(i,:)-2*pi;
elseif teta(i,:)==2*pi
teta(i,:)=0;
else
teta(i,:)=teta(i,:); %teta degerleri dogru
end
end
for i=1:n
beta(i,:)=teta(i,:)+(pi()/2); %beta degerleri dogru
if beta(i,:)<0;
beta(i,:)=beta(i,:)+(2*pi());
elseif beta(i,:)>(2*pi())
beta(i,:)=beta(i,:)-2*pi;

elseif beta(i,:)==2*pi
beta(i,:)=0;
else
beta(i,:)=beta(i,:);

%beta degerleri dogru

end
end

%% orta noktalar
clear i
for i=1:n
x(i,:)=((X(i+1)-X(i))/2)+X(i);
y(i,:)=((Y(i+1)-Y(i))/2)+Y(i);
plot(x(i,1),y(i,1),'.m')

% orta noktalar dogru bulundu

end
clear i
for i=1:n
S(i,:)=((X(i+1)-X(i))^2 + ((Y(i+1)-Y(i))^2))^0.5; %panel boylar tamam
end
clear i
clear j
%% abromovitz donsm ve kaynak siddetleri
for i=1:n
for j=1:n
A(i,j)=-(x(i)-X(j))*cos(teta(j))-((y(i)-Y(j))*sin(teta(j)));
B(i,j)=(x(i)-X(j))^2+ (y(i)-Y(j))^2;
C(i,j)=sin(teta(i)-teta(j));
D(i,j)=-(x(i)-X(j))*sin(teta(i))+(y(i)-Y(j))*cos(teta(i));
E(i,j)=(x(i)-X(j))*sin(teta(j))-(y(i)-Y(j))*cos(teta(j));
if i==j
I(i,j)=0.5;
Iy(i,j)=pi();
else
I(i,j)=(1/2*sin(teta(i)teta(j))*log(1+((S(j)^2+2*A(i,j)*S(j))/B(i,j)))-cos(teta(i)teta(j))*(atan((S(j)+A(i,j))/E(i,j))-atan(A(i,j)/E(i,j))))/(2*pi());
Iy(i,j)=(D(i,j)A(i,j)*C(i,j))/(2*E(i,j))*log(1+((S(j)^2+2*A(i,j)*S(j))/B(i,j)))C(i,j)*(atan2((S(j)+A(i,j)),E(i,j))-atan2(A(i,j),E(i,j)));
end
end
end
% I ve Iy(J(i,j)) degerleri dogru bulundu.
I(i,j)=I(j,i);
%Iy(i,j)=Iy(j,i); %matriste satrlar stunlar ters olmustu.
clear i
clear j
for i=1:n
sonuc(i,:)=-u*cos(beta(i));
end
%sonuc matrisi dogru
lamda=inv(I)*sonuc;

% lamda degerleri dogru bulundu.

%% hzlar ve basnclarn bulunmas


for i=1:1:n
hiz=0;
for j=1:1:n
hiz=hiz+Iy(i,j)*lamda(j,1)/(2*pi);
end
top_hiz(i,1)=hiz+u*sin(beta(i,1));
Cp(i,1)=1-(top_hiz(i,1)/u)^2;
end
for i=1:n
V_an(i,:)=2*u*sin(beta(i));
end
subplot(3,1,2)
hold on; grid on;

plot(teta,Cp,'+r')

ezplot('1-4*(cos(x)^2)',[0,2*pi])
set(gca,'XTick',0:pi/2:2*pi)
set(gca,'XTickLabel',{'0','pi/2','pi','3pi/2','2pi'})
xlabel('0 \leq \beta \leq 2\pi')
ylabel('C_P')
title(['Daire Etrafndaki Basn Dalm( ' num2str(n),' PANEL )'])
graf=legend('Nmerik zm','Analitik zm')
set(graf,'Location','southeast')

hold on; grid on;


subplot(3,1,3)
hold on; grid on;
ezplot('2*1*cos(x)',[0,2*pi])
plot(teta,top_hiz,'.m')
set(gca,'XTick',0:pi/2:2*pi)
set(gca,'XTickLabel',{'0','pi/2','pi','3pi/2','2pi'})
xlabel('0 \leq \beta \leq 2\pi')
ylabel('U')
title(['Daire Etrafndaki Hz Dalm( ' num2str(n),' PANEL )'])
graf=legend('Analitik zm','Nmerik zm')
set(graf,'Location','southeast')

For the circle;


Number of panels = 8
Collocation points = 0.5
LAMBDA
2,3656
1,6728
0,0000
-1,6728
-2,3656
-1,6728
0,0000
1,6728

THETA
Radian
1,5708
0,7854
0,0000
5,4978
4,7124
3,9270
3,1416
2,3562

Degree
90
45
0
315
270
225
180
135

The total of the strength of sources are 0 and this guarantees that the results are true up to now.
(I checked this code with the problem which was solved at the class and the results were the same.)

For the circle;


Number of panels = 20
Collocation points = 0.5

LAMBDA
2,1406
2,0358
1,7318
1,2582
0,6615
0,0000
-0,6615
-1,2582
-1,7318
-2,0358
-2,1406
-2,0358
-1,7318
-1,2582
-0,6615
0,0000
0,6615
1,2582
1,7318
2,0358

THETA
Radian
1,5708
1,2566
0,9425
0,6283
0,3142
6,2832
5,9690
5,6549
5,3407
5,0265
4,7124
4,3982
4,0841
3,7699
3,4558
3,1416
2,8274
2,5133
2,1991
1,8850

Degree
90
72
54
36
18
360
342
324
306
288
270
252
234
216
198
180
162
144
126
108

Again if we sum the lambdas, we can realize that this summation equals zero.

When we look the graphs we can say that the more number of panels, the nearer results to
the real. But also we can say that it cant answer totally correct even if the number of panels is
too high.

For the circle;


Number of panels = 20
Collocation points = 0.25

LAMBDA
2,069878
1,919748
1,581699
1,088822
0,489364
-0,158
-0,78989
-1,34447
-1,76743
-2,01739
-2,06988
-1,91975
-1,5817
-1,08882
-0,48936
0,157996
0,789891
1,344465
1,767434
2,017395

THETA
Radian

Degree

1,570796
1,256637
0,942478
0,628319
0,314159
6,283185
5,969026
5,654867
5,340708
5,026548
4,712389
4,39823
4,08407
3,769911
3,455752
3,141593
2,827433
2,513274
2,199115
1,884956

90
72
54
36
18
360
342
324
306
288
270
252
234
216
198
180
162
144
126
108

When we have selected the quarter of the panels as collocation points, the values of
lambdas have changed. But although they have changed, the summation has not changed and
it is still zero. So it still makes sense.

Theta
1,5708
1,2566
0,9425
0,6283
0,3142
6,2832
5,9690
5,6549
5,3407
5,0265
4,7124
4,3982
4,0841
3,7699
3,4558
3,1416
2,8274
2,5133
2,1991
1,8850

Collocation Points
0.25(col. pt.) 0.5(col. pt.)
1,396856
1,070307
1,913575
1,635956
2,242979
2,041467
2,352825
2,247145
2,23236
2,232856
1,893376
2
1,369056
1,57137
0,710722
0,988923
-0,01718
0,309674
-0,7434
-0,39989
-1,39686
-1,07031
-1,91357
-1,63596
-2,24298
-2,04147
-2,35283
-2,24714
-2,23236
-2,23286
-1,89338
-2
-1,36906
-1,57137
-0,71072
-0,98892
0,017182
-0,30967
0,743404
0,399888

Exact Result
2,0000
1,9021
1,6180
1,1756
0,6180
0,0000
-0,6180
-1,1756
-1,6180
-1,9021
-2,0000
-1,9021
-1,6180
-1,1756
-0,6180
0,0000
0,6180
1,1756
1,6180
1,9021
Total

Relative Error
0.25(col. pt.)
0.5(col. pt.)
0,3016
0,4648
0,0060
0,1399
0,3862
0,2617
1,0014
0,9115
2,6120
2,6128
too high
too high
3,2152
3,5425
1,6046
1,8412
0,9894
1,1914
0,6092
0,7898
0,3016
0,4648
0,0060
0,1399
0,3862
0,2617
1,0014
0,9115
2,6120
2,6128
too high
too high
3,2152
3,5425
1,6046
1,8412
0,9894
1,1914
0,6092
0,7898
21,4512
23,5115

If we want to compare this two situations for the 20 panels, we can clearly say that the results
which belongs to collocation points=0.25 are a little better than the others.

For the circle;


Number of panels = 8
Collocation points = 0.25
LAMBDA
2,1794
1,2513
-0,4098
-1,8309
-2,1794
-1,2513
0,4098
1,8309

THETA
Radian

Degree

1,5708
0,7854
0,0000
5,4978
4,7124
3,9270
3,1416
2,3562

90
45
0
315
270
225
180
135

As all the others, the summation of lambdas equals to zero and again as all the others the
values of lambdas make sense. For example they start as being positive like sources and then
they continue as being negative like sinks. When we think about the geometry of the circle, it
is exactly possible.

The influence of changing location of collocation points on the lambdas:

Lambda
0.25(col. pt.)
2,1794
1,2513
-0,4098
-1,8309
-2,1794
-1,2513
0,4098
1,8309

0.5(col. Pt.)
2,3656
1,6728
0,0000
-1,6728
-2,3656
-1,6728
0,0000
1,6728

Theta
1,5708
0,7854
0,0000
5,4978
4,7124
3,9270
3,1416
2,3562

Velocities
0.25(col. pt.)
1,4708
2,2587
1,7235
0,1787
-1,4708
-2,2587
-1,7235
-0,1787

0.5(col. pt.)
1,1828
2,2506
2,0000
0,5778
-1,1828
-2,2506
-2,0000
-0,5778

Exact Result

Relative Error

2,0000
1,4142
0,0000
-1,4142
-2,0000
-1,4142
0,0000
1,4142

0.25(col. pt.)
0,2646
0,5971
too high
1,1263
0,2646
0,5971
too high
1,1263

0.5(col. pt.)
0,4086
0,5914
too high
1,4086
0,4086
0,5914
too high
1,4086

Total

3,9761

4,8172

Lastly for this part, we can say that this method with these numbers of panels is not suitable
to model this situation correctly. The results can be better when the number of panels is
increased.
The differences between two situations, which are related to the location of control or
collocation points, increase when the number of panels increases. Although there is a
difference, it is not significant for the circle.

10

NACA0015

Naca 0015
0.08
0.06
0.04
0.02
0
-0.020.000
-0.04
-0.06
-0.08

0.100

0.200

0.300

0.400

0.500

0.600

0.700

0.800

0.900

The formula of the Naca profile:

The code from which I calculated the y and x values:


clc
clear all
format long
%% naca geometri hesaplama
t=0.7502;% maksimum kalnlk .
c=1; % kord uzunluu
N=5 ; %panel saysnn yars
db=pi/N;
u=1;

%% koordinatlarn belirlenmesi
for i=1:2*N+1
x(i,:)= c/2*(1-cos((i-1)*db));
end

% x degerleri dogru .

for j=1:2*N+1
y(j,:)=(2*c*t)/(10*0.2)*(0.2969*((x(j,1)/c)^0.5)-0.1260*(x(j,1)/c)0.3516*((x(j,1)/c)^2)+0.2843*((x(j,1)/c)^3)-0.1015*((x(j,1)/c)^4)); % y
degerleri 0.001 hassasiyetle doru
end

---------------------------------------------------------11

1.000

For the naca profile;


Number of panels = 10
Collocation points = 0.5

The coordinates are got from the upper code and then program continues calculation via the
code which is explained in early parts of the report.
The x and y values of the panels:
x
0,0000
0,0955
0,3455
0,6545
0,9045
1,0000
0,9045
0,6545
0,3455
0,0955
0,0000

y
0,0000
0,0576
0,0745
0,0512
0,0174
0,0000
-0,0174
-0,0512
-0,0745
-0,0576
0,0000

Because the profile is symmetric only for the x axis, the length of the panels is not the
same. So if we want to check the accuracy of the lambdas, we have to multiply each of them
with the panel lengths. Then we have to sum and it should be zero. But when we look at this
summation, we can say that the sensitivity of the system is 10 -3. Because when we calculate
the x and y values, we cant choose more sensitive formula. But it is important, system is still
symmetric.( I mean lambdas and panel lengths.)

Panel length LAMBDA


0,1115
0,2506
0,3099
0,2523
0,0971
0,0971
0,2523
0,3099
0,2506
0,1115

0,7584
0,0604
-0,1080
-0,1551
-0,1833
-0,1833
-0,1551
-0,1080
0,0604
0,7584

12

THETA
Radian
0,5426
0,0675
6,2078
6,1489
6,1030
3,3218
3,2758
3,2169
3,0740
2,5990

Degree
31,09
3,87
355,68
352,31
349,67
190,33
187,69
184,32
176,13
148,91

For the naca profile;


Number of panels = 10
Collocation points = 0.25

Panel length

LAMBDA

0,1115
0,2506
0,3099
0,2523
0,0971
0,0971
0,2523
0,3099
0,2506
0,1115

0,3481
-0,1487
-0,2620
-0,3150
-0,4371
0,1115
0,0173
0,0482
0,2515
1,0240

13

THETA
Radian
0,5426
0,0675
6,2078
6,1489
6,1030
3,3218
3,2758
3,2169
3,0740
2,5990

Degree
31,09
3,87
355,68
352,31
349,67
190,33
187,69
184,32
176,13
148,91

Theta
0,5426
0,0675
6,2078
6,1489
6,1030
3,3218
3,2758
3,2169
3,0740
2,5990

Velocities
0.25(col. pt.) 0.5(col. pt.)
1,2388
1,3850
1,1242
1,2334
0,9621
1,0771
0,8284
0,9638
0,6308
0,8434
-0,8663
-1,0267
-1,0150
-1,1189
-1,0770
-1,1851
-1,0131
-1,1730
-0,3529
-0,6266

Exact Result
2,0000
1,9021
1,6180
1,1756
0,6180
0,0000
-0,6180
-1,1756
-1,6180
-1,9021
Total

Relative Error
0.25(col. pt.) 0.5(col. pt.)
0,3806
0,3075
0,4090
0,3516
0,4054
0,3343
0,2953
0,1801
0,0207
0,3646
too high
too high
0,6422
0,8105
0,0839
0,0081
0,3739
0,2750
0,8145
0,6706
3,4255
3,3024

When we look at the differences of two situations, we can clearly say that for 10 panels,
there is no significant difference. But also we can say that putting the collocation points on the
quarter of the panel breaks the symmetry of the system.

14

For the naca profile;


Number of panels = 20
Collocation points = 0.5

Panel length LAMBDA


0,0406
0,0754
0,1116
0,1394
0,1547
0,1552
0,1405
0,1118
0,0720
0,0252
0,0252
0,0720
0,1118
0,1405
0,1552
0,1547
0,1394
0,1116
0,0754
0,0406

1,1927
0,4180
0,1420
-0,0039
-0,0855
-0,1272
-0,1485
-0,1609
-0,1652
-0,2237
-0,2237
-0,1652
-0,1609
-0,1485
-0,1272
-0,0855
-0,0039
0,1420
0,4180
1,1927

THETA
Radian
0,9235
0,3410
0,1311
0,0167
6,2295
6,1862
6,1581
6,1374
6,1214
6,0503
3,3745
3,3034
3,2874
3,2666
3,2386
3,1952
3,1249
3,0105
2,8006
2,2180

Degree
52,92
19,54
7,51
0,96
356,93
354,44
352,84
351,65
350,73
346,66
193,34
189,27
188,35
187,16
185,56
183,07
179,04
172,49
160,46
127,08

As before, because the profile is symmetric only for the x axis, the length of the panels is
not the same. So if we want to check the accuracy of the lambdas, we have to multiply each
of them with the panel lengths. Then we have to sum and it should be zero. But when we
look at this summation, we can say that the sensitivity of the system is 10-2. Because when
we calculate the x and y values, we cant choose more sensitive formula. But it is important,
system is still symmetric. (I mean lambdas and panel lengths.)

15

This graph has some accumulations especially at some degrees. Because of the geometry this is
possible. But also we can clearly say that almost all values are far from the exact values.

16

For the naca profile;


Number of panels = 20
Collocation points = 0.25

Panel length LAMBDA


0,0406
0,0754
0,1116
0,1394
0,1547
0,1552
0,1405
0,1118
0,0720
0,0252
0,0252
0,0720
0,1118
0,1405
0,1552
0,1547
0,1394
0,1116
0,0754
0,0406

0,9131
0,2287
0,0220
-0,0976
-0,1668
-0,2041
-0,2281
-0,2529
-0,2892
-0,4533
0,0537
-0,0276
-0,0623
-0,0651
-0,0481
-0,0031
0,0890
0,2559
0,5708
1,3197

THETA
Radian
0,9235
0,3410
0,1311
0,0167
6,2295
6,1862
6,1581
6,1374
6,1214
6,0503
3,3745
3,3034
3,2874
3,2666
3,2386
3,1952
3,1249
3,0105
2,8006
2,2180

Degree
52,92
19,54
7,51
0,96
356,93
354,44
352,84
351,65
350,73
346,66
193,34
189,27
188,35
187,16
185,56
183,07
179,04
172,49
160,46
127,08

As before, because the profile is symmetric only for the x axis, the length of the panels is
not the same. So if we want to check the accuracy of the lambdas, we have to multiply each
of them with the panel lengths. Then we have to sum and it should be zero. But when we
look at this summation, we can say that the sensitivity of the system is 10 -3. Because when
we calculate the x and y values, we cant choose more sensitive formula. But it is important,
system is still symmetric. (I mean lambdas and panel lengths.)

17

Theta
0,9235
0,3410
0,1311
0,0167
6,2295
6,1862
6,1581
6,1374
6,1214
6,0503
3,3745
3,3034
3,2874
3,2666
3,2386
3,1952
3,1249
3,0105
2,8006
2,2180

Velocities
0.25(col. pt.)
1,3594
1,3694
1,2459
1,1394
1,0481
0,9726
0,9063
0,8380
0,7538
0,5517
-0,8341
-0,9693
-1,0428
-1,0945
-1,1306
-1,1484
-1,1310
-1,0454
-0,7991
0,1078

0.5(col. pt.)
1,3388
1,4012
1,2969
1,1981
1,1133
1,0438
0,9848
0,9283
0,8705
0,7479
-0,9715
-1,0357
-1,0892
-1,1333
-1,1710
-1,1988
-1,2020
-1,1550
-0,9832
-0,1461

Exact Result

18

Relative Error

2,0000
1,9021
1,6180
1,1756
0,6180
0,0000
-0,6180
-1,1756
-1,6180
-1,9021
-2,0000
-1,9021
-1,6180
-1,1756
-0,6180
0,0000
0,6180
1,1756
1,6180
1,9021

0.25(col. pt.)
0,3203
0,2801
0,2300
0,0308
0,6958
too high
2,4664
1,7128
1,4659
1,2900
0,5830
0,4904
0,3555
0,0690
0,8294
too high
2,8300
1,8892
1,4939
0,9433

0.5(col. pt.)
0,3306
0,2633
0,1985
0,0191
0,8013
too high
2,5934
1,7897
1,5380
1,3932
0,5142
0,4555
0,3268
0,0360
0,8948
too high
2,9449
1,9825
1,6077
1,0768

Total

17,9758

18,7662

The influence of changing location of collocation points on the lambdas for the naca profie:
For 20 panels:
LAMBDA
0.5(col. pt.)
0.25(col.pt.)
1,1927
0,9131
0,4180
0,2287
0,1420
0,0220
-0,0039
-0,0976
-0,0855
-0,1668
-0,1272
-0,2041
-0,1485
-0,2281
-0,1609
-0,2529
-0,1652
-0,2892
-0,2237
-0,4533
-0,2237
0,0537
-0,1652
-0,0276
-0,1609
-0,0623
-0,1485
-0,0651
-0,1272
-0,0481
-0,0855
-0,0031
-0,0039
0,0890
0,1420
0,2559
0,4180
0,5708
1,1927
1,3197

Panel length
0,0406
0,0754
0,1116
0,1394
0,1547
0,1552
0,1405
0,1118
0,0720
0,0252
0,0252
0,0720
0,1118
0,1405
0,1552
0,1547
0,1394
0,1116
0,0754
0,0406

For 10 panels:

LAMBDA
0.5(col. pt.)
0,7584
0,0604
-0,1080
-0,1551
-0,1833
-0,1833
-0,1551
-0,1080
0,0604
0,7584

0.25(col.pt.)
0,3481
-0,1487
-0,2620
-0,3150
-0,4371
0,1115
0,0173
0,0482
0,2515
1,0240
19

Panel length
0,1115
0,2506
0,3099
0,2523
0,0971
0,0971
0,2523
0,3099
0,2506
0,1115

Conclusions:

1- For better modelling the flow, the number of panels has to be increased. I used 10 and 20
panels for the naca profile and 8 and 20 panels for the circle but they dont enough.

2- Selecting collocation points at half or quarter of the panels length has no significant effect
on the results for both of geometries.

3- Selecting collocation points at quarter of the panels breaks the symmetry of the lambdas.
So it means that it breaks the symmetry of the geometry for this method.

4- Because of third conclusion for this method the collocation points have to be selected at
the half of the panels length, if we dont want to break the symmetry.

5- Modelling the circle is easier than modelling the naca profiles. Because the former is
symmetric for both x and y axis.

(NOTE: Because Cp values are derived from the velocities, naturally, the comparisons about
the Cps are similar to the comparisons about the velocities.)

20

You might also like