of 20
7/26/2019 Modelling the flow via 2D constant source panel method
1/20
1
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 panelslengths.
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 allR=1;u=1;
filename='koordinatlar';zz=xlsread(filename); %koordinatlar girildin=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
fori=1:nteta(i,:)=atan2(Y(i+1,:)-Y(i,:),X(i+1,:)-X(i,:));
ifteta(i,:)2*piteta(i,:)=teta(i,:)-2*pi;
elseifteta(i,:)==2*piteta(i,:)=0;
elseteta(i,:)=teta(i,:); %teta degerleri dogru
endend
fori=1:nbeta(i,:)=teta(i,:)+(pi()/2); %beta degerleri dogru
ifbeta(i,:)(2*pi())beta(i,:)=beta(i,:)-2*pi;
7/26/2019 Modelling the flow via 2D constant source panel method
2/20
2
elseifbeta(i,:)==2*pibeta(i,:)=0;
elsebeta(i,:)=beta(i,:); %beta degerleri dogru
end
end
%% orta noktalarclear ifori=1:n
x(i,:)=((X(i+1)-X(i))/2)+X(i);y(i,:)=((Y(i+1)-Y(i))/2)+Y(i); % orta noktalar dogru bulunduplot(x(i,1),y(i,1),'.m')
endclear i
fori=1:nS(i,:)=((X(i+1)-X(i))^2 + ((Y(i+1)-Y(i))^2))^0.5; %panel boylar tamam
endclear iclear j
%% abromovitz donsm ve kaynak siddetlerifori=1:n
forj=1:nA(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)); ifi==jI(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)));
endend
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 iclear jfori=1:nsonuc(i,:)=-u*cos(beta(i));end%sonuc matrisi dogru
lamda=inv(I)*sonuc; % lamda degerleri dogru bulundu.
7/26/2019 Modelling the flow via 2D constant source panel method
3/20
3
%% hzlar ve basnclarn bulunmas
fori=1:1:nhiz=0;
forj=1:1:nhiz=hiz+Iy(i,j)*lamda(j,1)/(2*pi);
endtop_hiz(i,1)=hiz+u*sin(beta(i,1));Cp(i,1)=1-(top_hiz(i,1)/u)^2;end
fori=1:nV_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')
7/26/2019 Modelling the flow via 2D constant source panel method
4/20
4
For the circle;
Number of panels = 8
Collocation points = 0.5
LAMBDATHETA
Radian Degree
2,3656 1,5708 90
1,6728 0,7854 45
0,0000 0,0000 0
-1,6728 5,4978 315
-2,3656 4,7124 270
-1,6728 3,9270 225
0,0000 3,1416 180
1,6728 2,3562 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.)
7/26/2019 Modelling the flow via 2D constant source panel method
5/20
5
For the circle;
Number of panels = 20
Collocation points = 0.5
LAMBDATHETA
Radian Degree
2,1406 1,5708 90
2,0358 1,2566 72
1,7318 0,9425 54
1,2582 0,6283 36
0,6615 0,3142 18
0,0000 6,2832 360
-0,6615 5,9690 342
-1,2582 5,6549 324
-1,7318 5,3407 306
-2,0358 5,0265 288
-2,1406 4,7124 270
-2,0358 4,3982 252
-1,7318 4,0841 234
-1,2582 3,7699 216-0,6615 3,4558 198
0,0000 3,1416 180
0,6615 2,8274 162
1,2582 2,5133 144
1,7318 2,1991 126
2,0358 1,8850 108
Again if we sum the lambdas, we can realize that this summation equals zero.
7/26/2019 Modelling the flow via 2D constant source panel method
6/20
6
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.
7/26/2019 Modelling the flow via 2D constant source panel method
7/20
7
For the circle;
Number of panels = 20
Collocation points = 0.25
LAMBDATHETA
Radian Degree
2,069878 1,570796 90
1,919748 1,256637 72
1,581699 0,942478 54
1,088822 0,628319 36
0,489364 0,314159 18
-0,158 6,283185 360-0,78989 5,969026 342
-1,34447 5,654867 324
-1,76743 5,340708 306
-2,01739 5,026548 288
-2,06988 4,712389 270
-1,91975 4,39823 252
-1,5817 4,08407 234
-1,08882 3,769911 216
-0,48936 3,455752 198
0,157996 3,141593 180
0,789891 2,827433 162
1,344465 2,513274 144
1,767434 2,199115 126
2,017395 1,884956 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 andit is still zero. So it still makes sense.
7/26/2019 Modelling the flow via 2D constant source panel method
8/20
8
ThetaCollocation Points
Exact ResultRelative Error
0.25(col. pt.) 0.5(col. pt.) 0.25(col. pt.) 0.5(col. pt.)
1,5708 1,396856 1,070307 2,0000 0,3016 0,4648
1,2566 1,913575 1,635956 1,9021 0,0060 0,1399
0,9425 2,242979 2,041467 1,6180 0,3862 0,2617
0,6283 2,352825 2,247145 1,1756 1,0014 0,9115
0,3142 2,23236 2,232856 0,6180 2,6120 2,6128
6,2832 1,893376 2 0,0000 too high too high
5,9690 1,369056 1,57137 -0,6180 3,2152 3,5425
5,6549 0,710722 0,988923 -1,1756 1,6046 1,8412
5,3407 -0,01718 0,309674 -1,6180 0,9894 1,1914
5,0265 -0,7434 -0,39989 -1,9021 0,6092 0,7898
4,7124 -1,39686 -1,07031 -2,0000 0,3016 0,4648
4,3982 -1,91357 -1,63596 -1,9021 0,0060 0,13994,0841 -2,24298 -2,04147 -1,6180 0,3862 0,2617
3,7699 -2,35283 -2,24714 -1,1756 1,0014 0,9115
3,4558 -2,23236 -2,23286 -0,6180 2,6120 2,6128
3,1416 -1,89338 -2 0,0000 too high too high
2,8274 -1,36906 -1,57137 0,6180 3,2152 3,5425
2,5133 -0,71072 -0,98892 1,1756 1,6046 1,8412
2,1991 0,017182 -0,30967 1,6180 0,9894 1,1914
1,8850 0,743404 0,399888 1,9021 0,6092 0,7898
Total 21,4512 23,5115
7/26/2019 Modelling the flow via 2D constant source panel method
9/20
9
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
LAMBDATHETA
Radian Degree
2,1794 1,5708 90
1,2513 0,7854 45
-0,4098 0,0000 0
-1,8309 5,4978 315
-2,1794 4,7124 270
-1,2513 3,9270 225
0,4098 3,1416 180
1,8309 2,3562 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.) 0.5(col. Pt.)
2,1794 2,3656
1,2513 1,6728
-0,4098 0,0000
-1,8309 -1,6728
-2,1794 -2,3656
-1,2513 -1,6728
0,4098 0,0000
1,8309 1,6728
7/26/2019 Modelling the flow via 2D constant source panel method
10/20
10
ThetaVelocities
Exact ResultRelative Error
0.25(col. pt.) 0.5(col. pt.) 0.25(col. pt.) 0.5(col. pt.)
1,5708 1,4708 1,1828 2,0000 0,2646 0,4086
0,7854 2,2587 2,2506 1,4142 0,5971 0,5914
0,0000 1,7235 2,0000 0,0000 too high too high
5,4978 0,1787 0,5778 -1,4142 1,1263 1,4086
4,7124 -1,4708 -1,1828 -2,0000 0,2646 0,4086
3,9270 -2,2587 -2,2506 -1,4142 0,5971 0,5914
3,1416 -1,7235 -2,0000 0,0000 too high too high
2,3562 -0,1787 -0,5778 1,4142 1,1263 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.
7/26/2019 Modelling the flow via 2D constant source panel method
11/20
11
NACA0015
The formula of the Naca profile:
The code from which I calculated the y and x values:
clcclear allformat long%% naca geometri hesaplamat=0.7502;% maksimum kalnlk .c=1; % kord uzunluuN=5 ; %panel saysnn yarsdb=pi/N;u=1;
%% koordinatlarn belirlenmesi
fori=1:2*N+1x(i,:)= c/2*(1-cos((i-1)*db)); % x degerleri dogru .
end
forj=1:2*N+1y(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)); % ydegerleri 0.001 hassasiyetle doru
end
----------------------------------------------------------
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
0.000 0.100 0.200 0.300 0.400 0.500 0.600 0.700 0.800 0.900 1.000
Naca 0015
7/26/2019 Modelling the flow via 2D constant source panel method
12/20
12
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 y
0,0000 0,0000
0,0955 0,0576
0,3455 0,0745
0,6545 0,0512
0,9045 0,01741,0000 0,0000
0,9045 -0,0174
0,6545 -0,0512
0,3455 -0,0745
0,0955 -0,0576
0,0000 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 themwith 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 LAMBDATHETA
Radian Degree
0,1115 0,7584 0,5426 31,09
0,2506 0,0604 0,0675 3,870,3099 -0,1080 6,2078 355,68
0,2523 -0,1551 6,1489 352,31
0,0971 -0,1833 6,1030 349,67
0,0971 -0,1833 3,3218 190,33
0,2523 -0,1551 3,2758 187,69
0,3099 -0,1080 3,2169 184,32
0,2506 0,0604 3,0740 176,13
0,1115 0,7584 2,5990 148,91
7/26/2019 Modelling the flow via 2D constant source panel method
13/20
13
For the naca profile;
Number of panels = 10
Collocation points = 0.25
Panel length LAMBDATHETA
Radian Degree
0,1115 0,3481 0,5426 31,09
0,2506 -0,1487 0,0675 3,870,3099 -0,2620 6,2078 355,68
0,2523 -0,3150 6,1489 352,31
0,0971 -0,4371 6,1030 349,67
0,0971 0,1115 3,3218 190,33
0,2523 0,0173 3,2758 187,69
0,3099 0,0482 3,2169 184,32
0,2506 0,2515 3,0740 176,13
0,1115 1,0240 2,5990 148,91
7/26/2019 Modelling the flow via 2D constant source panel method
14/20
14
ThetaVelocities
Exact ResultRelative Error
0.25(col. pt.) 0.5(col. pt.) 0.25(col. pt.) 0.5(col. pt.)
0,5426 1,2388 1,3850 2,0000 0,3806 0,30750,0675 1,1242 1,2334 1,9021 0,4090 0,3516
6,2078 0,9621 1,0771 1,6180 0,4054 0,3343
6,1489 0,8284 0,9638 1,1756 0,2953 0,1801
6,1030 0,6308 0,8434 0,6180 0,0207 0,3646
3,3218 -0,8663 -1,0267 0,0000 too high too high
3,2758 -1,0150 -1,1189 -0,6180 0,6422 0,8105
3,2169 -1,0770 -1,1851 -1,1756 0,0839 0,0081
3,0740 -1,0131 -1,1730 -1,6180 0,3739 0,2750
2,5990 -0,3529 -0,6266 -1,9021 0,8145 0,6706
Total 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.
7/26/2019 Modelling the flow via 2D constant source panel method
15/20
15
For the naca profile;
Number of panels = 20
Collocation points = 0.5
Panel length LAMBDATHETA
Radian Degree
0,0406 1,1927 0,9235 52,92
0,0754 0,4180 0,3410 19,54
0,1116 0,1420 0,1311 7,51
0,1394 -0,0039 0,0167 0,96
0,1547 -0,0855 6,2295 356,93
0,1552 -0,1272 6,1862 354,44
0,1405 -0,1485 6,1581 352,84
0,1118 -0,1609 6,1374 351,65
0,0720 -0,1652 6,1214 350,73
0,0252 -0,2237 6,0503 346,66
0,0252 -0,2237 3,3745 193,34
0,0720 -0,1652 3,3034 189,27
0,1118 -0,1609 3,2874 188,35
0,1405 -0,1485 3,2666 187,16
0,1552 -0,1272 3,2386 185,56
0,1547 -0,0855 3,1952 183,07
0,1394 -0,0039 3,1249 179,040,1116 0,1420 3,0105 172,49
0,0754 0,4180 2,8006 160,46
0,0406 1,1927 2,2180 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.)
7/26/2019 Modelling the flow via 2D constant source panel method
16/20
16
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.
7/26/2019 Modelling the flow via 2D constant source panel method
17/20
17
For the naca profile;
Number of panels = 20
Collocation points = 0.25
Panel length LAMBDATHETA
Radian Degree
0,0406 0,9131 0,9235 52,92
0,0754 0,2287 0,3410 19,54
0,1116 0,0220 0,1311 7,51
0,1394 -0,0976 0,0167 0,96
0,1547 -0,1668 6,2295 356,930,1552 -0,2041 6,1862 354,44
0,1405 -0,2281 6,1581 352,84
0,1118 -0,2529 6,1374 351,65
0,0720 -0,2892 6,1214 350,73
0,0252 -0,4533 6,0503 346,66
0,0252 0,0537 3,3745 193,34
0,0720 -0,0276 3,3034 189,27
0,1118 -0,0623 3,2874 188,35
0,1405 -0,0651 3,2666 187,16
0,1552 -0,0481 3,2386 185,56
0,1547 -0,0031 3,1952 183,07
0,1394 0,0890 3,1249 179,04
0,1116 0,2559 3,0105 172,49
0,0754 0,5708 2,8006 160,46
0,0406 1,3197 2,2180 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.)
7/26/2019 Modelling the flow via 2D constant source panel method
18/20
18
ThetaVelocities
Exact ResultRelative Error
0.25(col. pt.) 0.5(col. pt.) 0.25(col. pt.) 0.5(col. pt.)
0,9235 1,3594 1,3388 2,0000 0,3203 0,3306
0,3410 1,3694 1,4012 1,9021 0,2801 0,2633
0,1311 1,2459 1,2969 1,6180 0,2300 0,1985
0,0167 1,1394 1,1981 1,1756 0,0308 0,01916,2295 1,0481 1,1133 0,6180 0,6958 0,8013
6,1862 0,9726 1,0438 0,0000 too high too high
6,1581 0,9063 0,9848 -0,6180 2,4664 2,5934
6,1374 0,8380 0,9283 -1,1756 1,7128 1,7897
6,1214 0,7538 0,8705 -1,6180 1,4659 1,5380
6,0503 0,5517 0,7479 -1,9021 1,2900 1,3932
3,3745 -0,8341 -0,9715 -2,0000 0,5830 0,5142
3,3034 -0,9693 -1,0357 -1,9021 0,4904 0,4555
3,2874 -1,0428 -1,0892 -1,6180 0,3555 0,3268
3,2666 -1,0945 -1,1333 -1,1756 0,0690 0,0360
3,2386 -1,1306 -1,1710 -0,6180 0,8294 0,8948
3,1952 -1,1484 -1,1988 0,0000 too high too high
3,1249 -1,1310 -1,2020 0,6180 2,8300 2,9449
3,0105 -1,0454 -1,1550 1,1756 1,8892 1,9825
2,8006 -0,7991 -0,9832 1,6180 1,4939 1,6077
2,2180 0,1078 -0,1461 1,9021 0,9433 1,0768
Total 17,9758 18,7662
7/26/2019 Modelling the flow via 2D constant source panel method
19/20
19
The influence of changing location of collocation points on the lambdas for the naca profie:
For 20 panels:
LAMBDAPanel length
0.5(col. pt.) 0.25(col.pt.)1,1927 0,9131 0,0406
0,4180 0,2287 0,0754
0,1420 0,0220 0,1116
-0,0039 -0,0976 0,1394
-0,0855 -0,1668 0,1547
-0,1272 -0,2041 0,1552
-0,1485 -0,2281 0,1405
-0,1609 -0,2529 0,1118
-0,1652 -0,2892 0,0720
-0,2237 -0,4533 0,0252
-0,2237 0,0537 0,0252
-0,1652 -0,0276 0,0720
-0,1609 -0,0623 0,1118
-0,1485 -0,0651 0,1405
-0,1272 -0,0481 0,1552
-0,0855 -0,0031 0,1547
-0,0039 0,0890 0,1394
0,1420 0,2559 0,1116
0,4180 0,5708 0,07541,1927 1,3197 0,0406
For 10 panels:
LAMBDAPanel length
0.5(col. pt.) 0.25(col.pt.)
0,7584 0,3481 0,1115
0,0604 -0,1487 0,2506
-0,1080 -0,2620 0,3099
-0,1551 -0,3150 0,2523
-0,1833 -0,4371 0,0971
-0,1833 0,1115 0,0971
-0,1551 0,0173 0,2523
-0,1080 0,0482 0,3099
0,0604 0,2515 0,25060,7584 1,0240 0,1115
7/26/2019 Modelling the flow via 2D constant source panel method
20/20
20
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 hasno 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 Cpvalues are derived from the velocities, naturally, the comparisons about
the Cps are similar to the comparisons about the velocities.)