Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

%--------Laminar boundary layer

lsep = 0; trans=0; endofsurf=0;


theta(1) = sqrt(0.075/(Re*dueds(1)));
i = 1;
while lsep ==0 & trans ==0 & endofsurf ==0
lambda = theta(i).^2*dueds(i)*Re;
% test for laminar separation
if lambda < -0.09
lsep = 1; itrans = i;
break;
end;
H(i) = fH(lambda); L = fL(lambda); cf(i) = 2*L./(Re*theta(i));
if i>1, cf(i) = cf(i)./ue(i); end;
i = i+1;
% test for end of surface
if i> n endofsurf = 1; itrans = n; break; end;
K = 0.45/Re; xm = (s(i)+s(i-1))/2; dx = (s(i)-s(i-1)); coeff = sqrt(3/5);
f1 = ppval(spues,xm-coeff*dx/2); f1 = f1^5; f2 = ppval(spues,xm); f2 = f2^5;
f3 = ppval(spues,xm+coeff*dx/2); f3 = f3^5; dth2ue6 = K*dx/18*(5*f1+8*f2+5*f3);
theta(i) = sqrt((theta(i-1).^2*ue(i-1).^6 + dth2ue6)./ue(i).^6);
% test for transition
rex = Re*s(i)*ue(i); ret = Re*theta(i)*ue(i); retmax = 1.174*(rex^0.46+22400*rex^(-
0.54));
if ret>retmax
trans = 1; itrans = i;
end;
end;
function H = fH(lambda);
if lambda < 0
if lambda==-0.14
lambda=-0.139;
end;
H = 2.088 + 0.0731./(lambda+0.14);
elseif lambda >= 0
H = 2.61 - 3.75*lambda + 5.24*lambda.^2;
end;
function L = fL(lambda);
if lambda < 0
if lambda==-0.107
lambda=-0.106;
end;
L = 0.22 + 1.402*lambda +(0.018*lambda)./(lambda+0.107);
elseif lambda >= 0
L = 0.22 + 1.57*lambda - 1.8*lambda.^2;
end;
We invoke (or call this function) at each i-location as follows:
H(i) = fH(lambda); L = fL(lambda); cf(i) = 2*L./(Re*theta(i));

You might also like