Professional Documents
Culture Documents
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 semiinfinite 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 selfsimilar solution of
Prandtls problem arising from laminar flow past a semiinfinite flat plate
leads to a oneparameter family of problems involving a third order
nonlinear ordinary differential equation on the semi-infinite domain .
u v
0
x y
Continuity Equation
u
u
1 dp
u
v
v
x
y
dx
y
2
u
Mass Momentum Equation
U
x
1
2
( ) Uu =f ( )
'
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 ' ' ( )
h' ( )=
so,
1
f () h ( )
2
a. Runge-Kutta Method
k
h
k 3 =f x n + , y n + 2 h
2
2
k 4=f ( xn +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
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 ( )
h' ( )=
1
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
10
10
10
(h ( 10 )ih ( 10 )i1)
g( i1)
h(10)i+1=h(10)i
h(0)=h(10)i+1
5. Flow Chart
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.
4.400000
4.500000
4.600000
4.700000
4.800000
4.900000
5.000000
5.100000
5.200000
5.300000
5.400000
5.500000
5.600000
5.700000
5.800000
5.900000
6.000000
6.100000
6.200000
6.300000
6.400000
6.500000
6.600000
6.700000
6.800000
6.900000
7.000000
7.100000
7.200000
7.300000
7.400000
7.500000
7.600000
7.700000
7.800000
7.900000
8.000000
8.100000
8.200000
8.300000
8.400000
8.500000
8.600000
8.700000
8.800000
8.900000
9.000000
9.100000
9.200000
9.300000
9.400000
2.692361
2.790134
2.888248
2.986657
3.085321
3.184204
3.283274
3.382503
3.481868
3.581346
3.680919
3.780572
3.880291
3.980064
4.079882
4.179737
4.279621
4.379530
4.479457
4.579401
4.679357
4.779322
4.879296
4.979276
5.079260
5.179248
5.279239
5.379232
5.479227
5.579223
5.679220
5.779218
5.879217
5.979215
6.079215
6.179214
6.279214
6.379213
6.479213
6.579213
6.679213
6.779213
6.879213
6.979213
7.079213
7.179213
7.279213
7.379212
7.479212
7.579212
7.679212
0.975871
0.979514
0.982683
0.985427
0.987789
0.989815
0.991542
0.993008
0.994245
0.995286
0.996155
0.996879
0.997478
0.997971
0.998375
0.998705
0.998973
0.999189
0.999363
0.999501
0.999612
0.999699
0.999768
0.999822
0.999864
0.999896
0.999922
0.999941
0.999956
0.999967
0.999975
0.999982
0.999987
0.999990
0.999993
0.999995
0.999996
0.999997
0.999998
0.999999
0.999999
0.999999
1.000000
1.000000
1.000000
1.000000
1.000000
1.000000
1.000000
1.000000
1.000000
0.038973
0.033981
0.029484
0.025457
0.021871
0.018698
0.015907
0.013465
0.011342
0.009506
0.007928
0.006579
0.005432
0.004463
0.003648
0.002968
0.002402
0.001935
0.001550
0.001236
0.000981
0.000774
0.000608
0.000475
0.000370
0.000286
0.000220
0.000169
0.000129
0.000098
0.000074
0.000055
0.000041
0.000031
0.000023
0.000017
0.000012
0.000009
0.000006
0.000005
0.000003
0.000002
0.000002
0.000001
0.000001
0.000001
0.000000
0.000000
0.000000
0.000000
0.000000
9.500000
9.600000
9.700000
9.800000
9.900000
10.000000
7.779212
7.879212
7.979212
8.079212
8.179212
8.279212
1.000000
1.000000
1.000000
1.000000
1.000000
1.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
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
disp(sprintf('%10f %10f %10f %10f',0,0,0,hf));
display(RK4(hf,1));
h'));
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