- #1
HoosierDaddy
- 5
- 0
Hello all,
I'm trying to write a bit of Matlab to solve the Blasius Equation f*f'' + f''' = 0, where at eta = 0, f' = 0, and at eta = infinity, f' = 1.
What I have so far is below...I'm a bit rusty. Two specific questions:
1. I'm trying to drive y2 to the b.c. of 1, however my loop appear to not be working.
2. Once I've solved the transformed equation in Matlab, how does it physically relate back to reality, in terms of boundary layer thickness and Cf?
Code:
%Define variables
%n = eta
%y1 = f
%y2 = df/dn = d(y1)/dn
%y3 = d^2f/dn^2 = d(y2)/dn
%d(y3)/dn = d^3/dn^3 = -y1*y3
%Clear values
clear;
clc;
%Initial conditions at n = 0
%f(0) = 0
y1 = 0;
%df/dn(0) = 0
y2 = 0;
%Need iniial guess for d^f/dn^2
y3 = .1;
%Need step size in eta
dn = 0.1;
%Set debugging counter
count = 0;
%Integration loop seeking target value of 1 for y2 = df/dn
if abs(y2-1) > 0.001
for n = dn:dn:10 %establish incremental range over eta
y1 = y1 + y2*dn;
y2 = y2 + y3*dn;
y3 = y3 + (-y1*y3)*dn;
end
count = count + 1;
end
y2
count
y3
Any help you can provide is greatly appreciated!
Thanks!
I'm trying to write a bit of Matlab to solve the Blasius Equation f*f'' + f''' = 0, where at eta = 0, f' = 0, and at eta = infinity, f' = 1.
What I have so far is below...I'm a bit rusty. Two specific questions:
1. I'm trying to drive y2 to the b.c. of 1, however my loop appear to not be working.
2. Once I've solved the transformed equation in Matlab, how does it physically relate back to reality, in terms of boundary layer thickness and Cf?
Code:
%Define variables
%n = eta
%y1 = f
%y2 = df/dn = d(y1)/dn
%y3 = d^2f/dn^2 = d(y2)/dn
%d(y3)/dn = d^3/dn^3 = -y1*y3
%Clear values
clear;
clc;
%Initial conditions at n = 0
%f(0) = 0
y1 = 0;
%df/dn(0) = 0
y2 = 0;
%Need iniial guess for d^f/dn^2
y3 = .1;
%Need step size in eta
dn = 0.1;
%Set debugging counter
count = 0;
%Integration loop seeking target value of 1 for y2 = df/dn
if abs(y2-1) > 0.001
for n = dn:dn:10 %establish incremental range over eta
y1 = y1 + y2*dn;
y2 = y2 + y3*dn;
y3 = y3 + (-y1*y3)*dn;
end
count = count + 1;
end
y2
count
y3
Any help you can provide is greatly appreciated!
Thanks!