Numerical Nonlinear Lifting Line Theory in MA

Click For Summary
The discussion focuses on issues encountered while implementing Anderson's Numerical Lifting Line Method in MATLAB for finite wing properties. The user reports incorrect circulation values and negative induced angles of attack, suggesting potential errors in the code structure or initial value definitions. The attached MATLAB code includes calculations for circulation, induced angles, lift, and drag, but the user is uncertain about the accuracy of the results. There is a request for assistance in troubleshooting the code to resolve these discrepancies. The conversation emphasizes the need for clarity in coding and validation of results in computational fluid dynamics applications.
meltems
1. Homework Statement
Hello all.
It is not a homework actually. I just didn't know at which forum I should post. I am working on a MATLAB code solving the finite wing properties iteratively by using the Anderson's Numerical Lifting Line Method. However, I got some wrong results. The circulation (c) values do not seem right and the code found the induced angle of attacks have negative values. I checked all equations. I think I may have mistakes at the structure of the code or while defining the initial values.

Many thanks in advance for any help given.

2. Homework Equations
The paper (3.44690) including the algorithm I follow is attached.

The Attempt at a Solution


The MATLAB code (nll) is also attached.
Matlab:
function nll
format longg
span=2;
ym=-span/2; %%%general lift distribution
yp=span/2;
noseg=101;
dy=(yp-ym)/(noseg-1);
vel=30;
locc=1000000; %%bu neden 1000000
% cdif=1;
alfa=0.1;

for i=1:noseg
y(i)=ym+(i-1)*dy;
c(i)=10*sqrt(1-(2*y(i)/span)^2); %%% c dediğimiz circulation. 10 bizim c0 ımız

end
y';
c';
%%
for i=1:(noseg-1)/2.+1
cbar(i)=0.3+(0.004*(i-1));
%cbar(i)=0.4;
end

for i=1:noseg
cbar(noseg+1-i)=cbar(i);
%cbar(i)=0.1;
end
%%%%%%%%%%%%%
cbar';

iter=0;
while (iter<=200)
iter=iter+1;
% cdif=0;
 
totint=0;
for j=1:noseg
 
 derc=0;
 down=0;
 intpart=0;
 
for i=1:noseg
if (i==1)
derc(i)=(c(i+1)-c(i))/(y(i+1)-y(i));
down(i)=y(j)-y(i);
intpart(i)=derc(i)/down(i);
elseif (i==noseg)
derc(i)=(c(i)-c(i-1))/(y(i)-y(i-1));
down(i)=y(j)-y(i);
intpart(i)=derc(i)/down(i);
    else
derc(i)=(c(i+1)-c(i-1))/(y(i+1)-y(i-1));
down(i)=y(j)-y(i);
intpart(i)=derc(i)/down(i);   
    end    
% locc;
if(abs(down(i))<(dy/10))
locc=i;
end
% locc;

end
% j;
% locc;

if (locc==1)
intpart(locc)=intpart(locc+1);
elseif(locc==noseg)
    intpart(locc)=intpart(locc-1);
else
        intpart(locc)=(intpart(locc-1)+intpart(locc+1))/2.;
end

% locc=10000000;
totint(j)=0;
for i=2:2:noseg-1;
totint(j)=totint(j)+dy/3*(intpart(i-1)+4*intpart(i)+intpart(i+1));
end

% totint(j);
aind(j)=totint(j)/(4.*acos(-1.)*vel);
aeff(j)=alfa-aind(j);
cl(j)=6.917*(aeff(j));

cnew(j)=0.5*vel*cbar(j)*cl(j);
j;
end
cold=c;
cold';
for i=1:noseg
c(i)=cold(i)+0.05*(cnew(i)-cold(i));
end
c';
aind';
cdif=1;
end

aind';
Lift=0;
indrag=0;
for i=2:2:noseg-1
Lift=Lift+dy*(c(i-1)+4*c(i)+c(i+1))/3.;
% indrag(2)=dy*(c(2-1)*aind(2-1)+4*c(2)*aind(2)+c(2+1)*aind(2+1))/3.;
indrag=indrag+dy*(c(i-1)*aind(i-1)+4*c(i)*aind(i)+c(i+1)*aind(i+1))/3.;
% indrag2(i)=indrag(i)*1.225*vel
end
Lift=Lift*1.225*vel;
indrag=indrag*1.225*vel
S=(cbar(1)+cbar((noseg-1)/2+1))/2.*span;
AR=span^2/S;
CL=Lift*2/(1.225*vel^2*S);
% cdi=indrag*2/(1.225*vel^2*S);
% oswald=CL^2/cdi/acos(-1.)/AR;

end
Added code tags jmc
 

Attachments

Last edited by a moderator:
Physics news on Phys.org
Code HTML tags added to improve readability.
 
I couldn't read the paper other than the references. The rest was blank.
 
magoo said:
I couldn't read the paper other than the references. The rest was blank.

Oh, I can see the rest of it. Here is the algorithm I followed.

upload_2017-7-5_10-22-46.png

upload_2017-7-5_10-22-58.png
 

Attachments

  • upload_2017-7-5_10-21-46.png
    upload_2017-7-5_10-21-46.png
    38.1 KB · Views: 620
  • upload_2017-7-5_10-22-21.png
    upload_2017-7-5_10-22-21.png
    60 KB · Views: 654
jim mcnamara said:
Code HTML tags added to improve readability.
Thank you
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
16K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 16 ·
Replies
16
Views
1K
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K