Ruturaj Arvind Umaranikar 200979009 Assignment 3
Ruturaj Arvind Umaranikar 200979009 Assignment 3
Ruturaj Arvind Umaranikar 200979009 Assignment 3
Assignment No. 3
Name- Ruturaj Arvind Umaranikar
Reg. No. - 200979009
Que. Obtain numerical solution for the second order ODE νu´´ + u´ + u = 0 using boundary
conditions; u(0) = 0 ; u(1) = 0.5
Algorithm –
• Discretize the given domain 0 ≤ η ≤ 1 into J-1 panels and assign each node with the indices
j = 1, 2, 3,.., J. Here J = 101.
• Apply the central difference algorithm to obtain u´´ and u´ and substitute the values in the
given ODE.
• By using Thomas Algorithm i.e. Gauss Elimination Method back substitution process we find 𝑢𝑗 by the
following formula,
In which,
• Calculated values are plotted in the graph Repeat the process for different values of Kinematic
Viscosity ()
Flow Chart-
Matlab Code-
clc; clear all;
v = 0.10;
J = 101;
deta = 1 /(J-1);
a = 1-(deta/(2*v));
b = -2+((deta^2)/v);
c = 1+ (deta/(2*v));
u = 1:J;
u(1) = 0;
u(J) = 0.5;
alpha = 1:J-1;
beta = 1:J-1;
alpha(1) = 0;
beta(1) = 0;
for k = 1:1:J
eta (k) = (k-1)*deta;
end
for i = 2:1:J-1
alpha (i) = -c/((a*alpha(i-1))+b);
beta (i) = ((-a)*beta(i-1))/(a*alpha(i-1)+b);
end
for j = J-1:-1:2
u(j) = alpha(j)*u(j+1)+ beta(j);
end
plot (eta, u, 'b')
hold on
%plot (eta, u, 'g')
hold on
%plot (eta, u, 'r')
hold on
Plot-
Que- Obtain numerical solution for the non-linear ODE u´´ - 2uu´ = 0 using boundary conditions;
u(0) = 0, u(5) = 1.
Algorithm
• Discretize the given domain 0 ≤ η ≤ 5 into J-1 panels, and assign each node with the indices
j = 1, 2, 3,..., J. Here J = 101.
• Calculate the grid spacing Δη = 5/( 𝐽−1).
• Using Taylor series and Newton Raphson method to discretize the non-linear part of the ODE, we
get
• Applying the central difference algorithm we get following,
Where,
Where,
• Compare the values of calculated u and initialized u. If they are the same then stop iteration,
else continue till they are the same
Flow Chart-
Matlab Code
clc;
clear all;
J = 101;
deleta = 5/(J-1);
U = 1:J;
U1 = 1:J;
U2 = 1:J;
A = 1:J;
B = 1:J;
C = 1:J;
D = 1:J;
alpha = 1:J;
beta = 1:J;
U(1) = 0 ; U(J) = 1;
alpha(1) = 0 ; beta(1) = 0;
e = 0.1;
for n = 1:1:J;
eta(n)= (n-1)*deleta;
U(n)= sqrt (eta(n)/5);
if 0<eta(n)<1;
U1(n)=eta(n);
else
U1(n)=1;
end
end
for j= 2 :1 :J;
for m = 2:1:(J-1);
U2(m)= ((U1(m+1)-U1(m-1))/(2*deleta));
A(m)= 1+(deleta*U1(m));
B(m)= -2*(1+((deleta^2)*U2(m)));
C(m)= 1-(deleta*U1(m));
D(m)= (-2)*(deleta^2)*U1(m)*U2(m);
alpha(m)= ((-C(m))/((A(m)*alpha(m-1))+B(m)));
beta(m)= (D(m)-(A(m)*beta(m-1)))/((A(m)*alpha(m-1))+B(m));
end
for k = (J-1):-1:2
U(k)= (alpha(k)*U(k+1))+beta(k);
end
error = abs (U(j)-U1(j))
if error < e
U(j)=U(j);
else
U1(j)=U(j);
end
end
plot ( eta, U )
hold on
Plot-
𝟏
Que. Obtain numerical solution of Blasius equation f´´´ + 𝟐 f f´´ = 0 under the boundary conditions
Algorithm
• Divide the given domain 0 ≤ η ≤ 10 into J-1 panels, and assign each node with the indices
j = 1, 2, 3,..., J. Here J = 101.
10
• Calculate the grid spacing Δη = 𝐽−1
• Use Thomas algorithm to calculate 𝑔𝑗 . For that first calculating the values of 𝑅𝑗 , 𝑆𝑗 , 𝑇𝑗 , 𝑉𝑗 .
𝐽−1
• Apply central difference formula at a point to calculate 𝑓𝑗 .
2
• Compare the values of calculated f, g and initialised F, G. If they are same then stop iteration,
else continue till they are same.
clc;
clear all;
J = 101; n0 = 0; n1 = 10;
deta = (n1-n0)/(J-1);
e = 0.01;
f = 1:J; g = 1:J;
eta = 1:J; GD = 1:J;
f(1) = 0; g(1) = 0;
G = 1:J;
F = 1:J;
A = 1:J; B = 1:J;
C = 1:J; D = 1:J; E = 1:J;
R = 1:J; S = 1:J; T = 1:J; V =1:J;
R(J) = 1; S(J) = 0; T(J) = 0;
for i = 1:1:J
eta (i) = (i-1)*deta;
end
for m = 1:1:J
if 0<eta(m)<1
F (m) = ((eta(m))^2)/2;
G (m) = eta (m);
else
F (m) = eta(m)-(1/2);
G (m) = 1;
end
end
for n= 2:1:J
for k = 2:1:J-1
GD (k) = (G(k+1)-G(k-1))/(2*deta);
A (k) = 1+((deta*F(k))/4);
B (k) = -2;
C (k) = 1-((deta*F(k))/4);
D (k) =(deta^2)*GD(k)/2;
E (k) = (deta^2)*F(k)*GD(k)/2;
end
for z = J-1:-1:2
V(z) = (A(z)*S(z+1))+B(z)+(deta*(A(z)*T(z+1))+D(z))/2;
R(z) = (E(z)-(A(z)*R(z+1)))/V(z);
S(z) = -(C(z)+(deta*(A(z)*T(z+1)+D(z))/2))/V(z);
T(z) = -(A(z)*T(z+1)+D(z))/V(z);
end
for j = 2:1:J
g(j)= R(j)+S(j)*g(j-1)+T(j)*f(j-1);
f(j)= f(j-1)+(deta/2)*(g(j)+g(j-1));
end
error = abs (g(n)-G(n))
if error < e
f(n)=f(n);
g(n)=g(n);
else
F(n) = f(n);
G(n) = g(n);
end
end
plot (eta,g,'g')
hold on
plot (eta,f,'r')
Plot -
Analysis of Flat Plate Boundary Layer-
Let’s select Reynold’s Number Re = 3 × 105 and as X is a dimensionless quantity so it varies only
between 0 to 1. We are analysing at mid span of plate length and at its trailing edge so we select
X = 0.5 and X = 1, 𝐿∗ is the length of plate in m and is 8.5 m.
∗
1. Boundary Layer Thickness - 𝛿99 , 𝑚.
5 × √𝑋
𝛿99 =
√𝑅𝑒
∗
𝛿99 = 𝛿99 × 𝐿∗
2. Displacement Thickness - 𝛿1∗ , 𝑚.
1.7208 × √𝑋
𝛿1 =
√𝑅𝑒
𝛿1∗ = 𝛿1 × 𝐿∗
3. Momentum Thickness – 𝛿2∗ , 𝑚.
0.664 × √𝑋
𝛿2 =
√𝑅𝑒
𝛿2∗ = 𝛿2 × 𝐿∗
∗
4. For given values, calculations of Boundary Layer Thickness - 𝛿99 , Displacement Thickness -
𝛿1∗ , Momentum Thickness – 𝛿2∗ are tabulated below,
X 𝛿99 𝛿1 𝛿2
0.5 0.006455 0.002222 0.000857
1 0.009129 0.003142 0.001212
∗
𝛿99 = 𝛿99 × 𝐿∗ 𝛿1∗ = 𝛿1 × 𝐿∗ 𝛿2∗ = 𝛿2 × 𝐿∗
0.01883 0.007286 0.054867
0.026705 0.010304 0.077594