Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

The Partial Differential Equation For The Blasius Equation

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

Advanced Fluid Mechanics

Coding Assignment - 1

1. Problem Definition
To solve the partial differential equation for the Blasius Equation

1
f ' ' ' ( η )+ f ' ' ( η ) f ( η ) =0
2

This is the governing equation for a laminar flow past a semi–infinite flat plate which is
derived from the continuity equation and mass momentum equation by introducing single
composite dimensionless variable η. In this assignment, the approach is to solve Blasius
equation numerically using Runge-Kutta Method and Newton Raphson Method.

2. Governing Equation
Blasius found a classical approach to find the self–similar solution of Prandtl’s problem
arising from laminar flow past a semi–infinite flat plate leads to a one–parameter family of
problems involving a third order nonlinear ordinary differential equation on the semi-infinite
domain .

Fig.1 Boundary layer formation on flat plate

For laminar flow past the flat plate, the boundary layer equations given below can be solved
exactly for u and v being velocities in x and y axis direction, assuming that the free-stream
velocity U is constant (dU/dx =0).
∂u ∂v
+ =0
Continuity Equation ∂x ∂ y
2
∂u ∂u 1 dp ∂u
u +v =− +v 2
Mass Momentum Equation ∂x ∂y ρ dx ∂y

The solution was given by Blasius. With an ingenious coordinate transformation, Blasius
showed that the dimensionless velocity profile u/U is a function only of the single composite
dimensionless variable η. The value of η is given by, where γ being kinematic viscosity.
1
η= y ( ) Uu =f ( η)
U
γx
2 '

The substitution of the above two equations in governing equation and by simplification, the
equation becomes as below for a flow past flat plate.

'' ' 1 ''


f ( η )+ f ( η ) f ( η ) =0
2

This equation is a third order partial differential equation with two initial conditions and one
boundary conditions. The initial and boundary conditions are

At y=0 , f ( 0 )=f , ( 0 )=0

At y=ϖ , f , ( ϖ , )=1.0

As the above equation has only two initial conditions and one boundary value, the equation
can be converted into three linear single degree partial differential equation and solved
numerically using Runge-Kutta Method and Newton Raphson Method. Newton Raphson
method is used for predicting the value of f’’(0).

The governing equation can be written as three ordinary differential equation

1
f ' ' ' ( η )+ f ' ' ( η ) f ( η ) =0
2

Let us assume,

g(η)=f ' (η)

h ( η ) =g ' ( η ) =f ' ' ( η )

−1
so, h' ( η ) = × f ( η)×h ( η )
2

a. Runge-Kutta Method
The Runge–Kutta method is an important family of implicit and explicit iterative methods,
which are used in temporal discretization for the approximation of solutions of ordinary
differential equations. The fourth-order Runge-Kutta method requires four evaluations per
step h. Here k1, k2, k3 and k4 are constants of that are being evaluated for the finding the
solution of the above three equations.

k 1=f ( x n , y n)

h k
(
k 2=f x n+ , y n+ 1 h
2 2 )
h k
(
k 3=f x n+ , y n+ 2 h
2 2 )
k 4=f ( x n+ h , y n + k 3 h )

h
y n+ 1= y n + × ( k 1 +2× k 2 +2 ×k 3 + k 4 )
6

b. Newton Raphson Method


Newton's method is a method for finding successively better approximations to the roots (or
zeroes) of a real-valued function. The method gives roots of the equation and are given by
f (x)
x i+1=x i− '
f (x )
For the finding of the initial value of h(0), the above method is utilised.

3. Initial Conditions
This is a third order partial differential equation with two initial conditions and one
boundary conditions. The boundary and initial conditions are

At y=0 , f ( 0 )=f , ( 0 )=0

At y=ϖ , f , ( ϖ , )=1.0

4. Mathematical Formulation
Blasius Equation for a flow past a flat plate is given by

1
f ' ' ' ( η )+ f ' ' ( η ) f ( η ) =0
2

Let us assume, g(η)=f ' (η)

h ( η ) =g ' ( η ) =f ' ' ( η )

Hence, the above third order equation can be converted into the following three linear
ordinary single order differential equations.
f ' ( η ) =g (η)
g' ( η )=h ( η )

−1
h' ( η ) = × f ( η)×h ( η )
2

The above three linear ordinary differential equation can be solved by RK4 method by
having the initial conditions as

f ( 0 )=0

f ' ( 0 ) =g (0)=0

f , ( ϖ )=g(ϖ )=1.0

As there is no initial valve for third equation, the initial value for h is evaluated using Newton
Raphson method for the root of the equation

g ( ϖ )−1.0=0

The expression for Newton Raphson is given by

h(10)i +1=h(10)i−¿

h(0)=h(10)i+1
5. Flow Chart

START

Input the governing equations


f’=g
g’=h
h’=-0.5xfxh

In initial and boundary


conditions
f(0)=0
g(0)=0
g(10)=0

Guess initial values of h(0)

Estimate the value of g(10) using RK4


method using step size h=0.1

Let I =0

Evaluate K1=f(e,f,g,h)
K2=f(e+0.5h,f+0.5K1h, g+0.5K1h ,h+0.5K1h,)
K3=f(e+0.5h,f+0.5K2xh, g+0.5K2xh ,h+0.5K2xh,)
K4=f(e+h,f+K3xh, g+K3xh, h+K2xh)
f(i+1)=f(i)+h(K1+2K2+2K3+K4)/6

Evaluate
K1=h(e,f,g,h)
K2=h(e+0.5h,f+0.5K1h, g+0.5K1h ,h+0.5K1h,)
K3=h(e+0.5h,f+0.5K2xh, g+0.5K2xh ,h+0.5K2xh,)
K4=h(e+h,f+K3xh, g+K3xh, h+K2xh)
h(i+1)=h(i)+h(K1+2K2+2K3+K4)/6

Evaluate K1=g(e,f,g,h)
K2=g(e+0.5h,f+0.5K1h, g+0.5K1h ,h+0.5K1h,)
K3=g(e+0.5h,f+0.5K2xh, g+0.5K2xh ,h+0.5K2xh,)
K4=g(e+h,f+K3xh, g+K3xh, h+K2xh)
g(i+1)=g(i)+h(K1+2K2+2K3+K4)/6

Compare
i=i+h
i=10

If g(10)-1<10^-
5

A
A

With f(0)=0
g(0)=0
and h(0) = h(10)

Let I =0

Evaluate K1=f(e,f,g,h)
K2=f(e+0.5h,f+0.5K1h, g+0.5K1h ,h+0.5K1h,)
K3=f(e+0.5h,f+0.5K2xh, g+0.5K2xh ,h+0.5K2xh,)
K4=f(e+h,f+K3xh, g+K3xh, h+K2xh)
f(i+1)=f(i)+h(K1+2K2+2K3+K4)/6

Evaluate
K1=h(e,f,g,h)
K2=h(e+0.5h,f+0.5K1h, g+0.5K1h ,h+0.5K1h,)
K3=h(e+0.5h,f+0.5K2xh, g+0.5K2xh ,h+0.5K2xh,)
K4=h(e+h,f+K3xh, g+K3xh, h+K2xh)
h(i+1)=h(i)+h(K1+2K2+2K3+K4)/6

Evaluate K1=g(e,f,g,h)
K2=g(e+0.5h,f+0.5K1h, g+0.5K1h ,h+0.5K1h,)
K3=g(e+0.5h,f+0.5K2xh, g+0.5K2xh ,h+0.5K2xh,)
K4=g(e+h,f+K3xh, g+K3xh, h+K2xh)
g(i+1)=g(i)+h(K1+2K2+2K3+K4)/6

Compare
i=i+h
i=10

Print f(i+1), g(i+1),h(i+1)

Plot e Vs f,g,h

Stop

6. Results
The code for solving the Blasius Equation is written in MATLAB verison 2012b. The code is
executed and the result is given below. The value for h(0) is found to be 0.332057 using
Newton Raphson Method.
--------------------------------------------------------------
Advanced Fluid Mechanics - Code:AM5531
Coding Assignment
Name: Dhiwakar V M Roll No: AM15M015
Program to solve Blasius equation using RungeKutta Method(RK4)
--------------------------------------------------------------
eta f g h
0.000000 0.000000 0.000000 0.332057
0.100000 0.001660 0.033206 0.332048
0.200000 0.006641 0.066408 0.331984
0.300000 0.014941 0.099599 0.331809
0.400000 0.026560 0.132764 0.331470
0.500000 0.041493 0.165885 0.330911
0.600000 0.059735 0.198937 0.330079
0.700000 0.081277 0.231890 0.328922
0.800000 0.106108 0.264709 0.327389
0.900000 0.134213 0.297354 0.325433
1.000000 0.165572 0.329780 0.323007
1.100000 0.200160 0.361938 0.320072
1.200000 0.237949 0.393776 0.316589
1.300000 0.278903 0.425237 0.312529
1.400000 0.322982 0.456262 0.307865
1.500000 0.370139 0.486789 0.302581
1.600000 0.420321 0.516757 0.296663
1.700000 0.473469 0.546101 0.290112
1.800000 0.529518 0.574758 0.282931
1.900000 0.588396 0.602667 0.275136
2.000000 0.650024 0.629766 0.266752
2.100000 0.714320 0.655998 0.257809
2.200000 0.781193 0.681310 0.248351
2.300000 0.850550 0.705653 0.238426
2.400000 0.922290 0.728982 0.228092
2.500000 0.996311 0.751260 0.217412
2.600000 1.072506 0.772455 0.206455
2.700000 1.150765 0.792544 0.195294
2.800000 1.230977 0.811510 0.184007
2.900000 1.313030 0.829343 0.172669
3.000000 1.396808 0.846044 0.161360
3.100000 1.482201 0.861619 0.150155
3.200000 1.569095 0.876081 0.139128
3.300000 1.657381 0.889453 0.128347
3.400000 1.746950 0.901761 0.117876
3.500000 1.837699 0.913040 0.107773
3.600000 1.929525 0.923330 0.098086
3.700000 2.022333 0.932673 0.088859
3.800000 2.116030 0.941118 0.080126
3.900000 2.210528 0.948715 0.071912
4.000000 2.305747 0.955518 0.064234
4.100000 2.401607 0.961580 0.057103
4.200000 2.498040 0.966957 0.050520
4.300000 2.594978 0.971703 0.044480
4.400000 2.692361 0.975871 0.038973
4.500000 2.790134 0.979514 0.033981
4.600000 2.888248 0.982683 0.029484
4.700000 2.986657 0.985427 0.025457
4.800000 3.085321 0.987789 0.021871
4.900000 3.184204 0.989815 0.018698
5.000000 3.283274 0.991542 0.015907
5.100000 3.382503 0.993008 0.013465
5.200000 3.481868 0.994245 0.011342
5.300000 3.581346 0.995286 0.009506
5.400000 3.680919 0.996155 0.007928
5.500000 3.780572 0.996879 0.006579
5.600000 3.880291 0.997478 0.005432
5.700000 3.980064 0.997971 0.004463
5.800000 4.079882 0.998375 0.003648
5.900000 4.179737 0.998705 0.002968
6.000000 4.279621 0.998973 0.002402
6.100000 4.379530 0.999189 0.001935
6.200000 4.479457 0.999363 0.001550
6.300000 4.579401 0.999501 0.001236
6.400000 4.679357 0.999612 0.000981
6.500000 4.779322 0.999699 0.000774
6.600000 4.879296 0.999768 0.000608
6.700000 4.979276 0.999822 0.000475
6.800000 5.079260 0.999864 0.000370
6.900000 5.179248 0.999896 0.000286
7.000000 5.279239 0.999922 0.000220
7.100000 5.379232 0.999941 0.000169
7.200000 5.479227 0.999956 0.000129
7.300000 5.579223 0.999967 0.000098
7.400000 5.679220 0.999975 0.000074
7.500000 5.779218 0.999982 0.000055
7.600000 5.879217 0.999987 0.000041
7.700000 5.979215 0.999990 0.000031
7.800000 6.079215 0.999993 0.000023
7.900000 6.179214 0.999995 0.000017
8.000000 6.279214 0.999996 0.000012
8.100000 6.379213 0.999997 0.000009
8.200000 6.479213 0.999998 0.000006
8.300000 6.579213 0.999999 0.000005
8.400000 6.679213 0.999999 0.000003
8.500000 6.779213 0.999999 0.000002
8.600000 6.879213 1.000000 0.000002
8.700000 6.979213 1.000000 0.000001
8.800000 7.079213 1.000000 0.000001
8.900000 7.179213 1.000000 0.000001
9.000000 7.279213 1.000000 0.000000
9.100000 7.379212 1.000000 0.000000
9.200000 7.479212 1.000000 0.000000
9.300000 7.579212 1.000000 0.000000
9.400000 7.679212 1.000000 0.000000
9.500000 7.779212 1.000000 0.000000
9.600000 7.879212 1.000000 0.000000
9.700000 7.979212 1.000000 0.000000
9.800000 8.079212 1.000000 0.000000
9.900000 8.179212 1.000000 0.000000
10.000000 8.279212 1.000000 0.000000

7. Appendix (MATLAB Code)

The matlab code appended below has a subroutine RK4 which calculates the expected value at η =10

clear all;
clc;
disp('-----------------------------------------------------');
disp('Advanced Fluid Mechanics - Code:AM5531');
disp('Coding Assignment ');
disp('Name: Dhiwakar V M Roll No:
AM15M015');
disp('Program to solve Blasius equation using RungeKutta
Method(RK4)');
disp('-----------------------------------------------------');
err=10;
h1=0.1;
h2=0.2;
ci=RK4(h1,0);
cf=RK4(h2,0);
while (abs(err)>.000001)
hf=h2-(cf-1)*(h2-h1)/(cf-ci);
err=cf-1;
h1=h2;
h2=hf;
ci=cf;
cf=RK4(hf,0);
end
disp(sprintf(' eta f g h'));
disp(sprintf('%10f %10f %10f %10f',0,0,0,hf));
display(RK4(hf,1));

Subroutine for Rung-Kutta Method(RK4) is given below and has to saved in the name
RK4.m in the same folder of the main program.

function C = RK4(X,P)
an(1)=0;
af(1)=0;
ag(1)=0;
ah(1)=X;
df=g;
dg=h;
dh=-0.5*f*h;
i=1;
hh=0.1;
for co=0:hh:10
kf1=ag(i);
kg1=ah(i);
kh1=-0.5*af(i)*ah(i);

kf2=(ag(i)+0.5*kg1*hh);
kg2=(ah(i)+0.5*kh1*hh);
kh2=-0.5*(af(i)+.5*kf1*hh)*(ah(i)+0.5*kh1*hh);

kf3=(ag(i)+0.5*kg2*hh);
kg3=(ah(i)+0.5*kh2*hh);
kh3=-0.5*(af(i)+.5*kf2*hh)*(ah(i)+0.5*kh2*hh);

kf4=(ag(i)+kg3*hh);
kg4=(ah(i)+kh3*hh);
kh4=-0.5*(af(i)+kf3*hh)*(ah(i)+kh3*hh);

an(i+1)=an(i)+hh;
af(i+1)=(af(i)+1/6*(kf1+2*kf2+2*kf3+kf4)*hh);
ag(i+1)=(ag(i)+1/6*(kg1+2*kg2+2*kg3+kg4)*hh);
ah(i+1)=(ah(i)+1/6*(kh1+2*kh2+2*kh3+kh4)*hh);

i=i+1;
if(P==1)
disp(sprintf('%10f %10f %10f %10f',an(i),af(i),ag(i),
ah(i)));
end
end
C = ag(i);

if(P==1)
plot(an,af,'b');
hold on
plot(an,ag,'r');
plot(an,ah,'g');
title('Solution for Blasius Equation for a Flat Plate')
xlabel('eta')
ylabel('f')
end

You might also like