Shooting Method to solve Blasius equation

Click For Summary

Discussion Overview

The discussion revolves around the implementation of the shooting method to solve the Blasius equation, specifically the equation f*f'' + f''' = 0, with boundary conditions at eta = 0 and eta approaching infinity. Participants are sharing their approaches, code snippets, and seeking advice on numerical integration techniques and the physical interpretation of results.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant shares their initial Matlab code and expresses difficulty in achieving the boundary condition of y2 = 1.
  • Another participant criticizes the use of a forward Euler method for integration, suggesting the use of a more robust method like rkf45.
  • It is proposed that initial conditions must be reset for each iteration to converge towards the desired boundary condition.
  • A suggestion is made to use Newton's method for iterating on the initial conditions to improve convergence.
  • Concerns are raised about the integration cutoff when y' exceeds 1.0, recommending a fixed value of eta (e.g., eta = 10) to ensure sufficient integration towards infinity.
  • Another participant emphasizes the importance of testing the boundary condition at a predetermined eta value and suggests substituting known values to verify the integration's accuracy.
  • A separate participant requests assistance in finding the value of f''(0) in the Blasius equation or a simpler Matlab code.

Areas of Agreement / Disagreement

Participants express differing views on the appropriate numerical methods for integration and the handling of initial conditions. There is no consensus on a single approach, and multiple strategies are proposed for solving the Blasius equation.

Contextual Notes

Participants mention limitations related to the choice of integration methods, the need for careful handling of boundary conditions, and the importance of iterating initial guesses effectively. Specific values for eta and the accuracy of the integration method are also discussed, but no definitive solutions are provided.

Who May Find This Useful

This discussion may be useful for individuals interested in numerical methods for solving differential equations, particularly in fluid dynamics, as well as those looking for coding assistance in Matlab related to the Blasius equation.

HoosierDaddy
Messages
4
Reaction score
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!
 
Physics news on Phys.org
HoosierDaddy said:
%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
What are you doing here?

First, that is not an acceptable way to integrate a system of ODEs. Since you are using Matlab, take a robust method such as rkf45.

Second, you don't loop over the integration many times until you (magically) get the right boundary condition. You have to integrate every time starting from a set of initial conditions, and these have to be modified intelligently so that at each iteration you get closer to the desired target.
 
Dr Claude is right. You have to reset the initial conditions on all the dependent variables each time you restart the integration. You also need to use a better algorithm for converging to the final solution using the shooting method. I always use Newton's method, evaluating the partial derivative of the error with respect to the unknown initial condition numerically. This requires you to got through the integration twice in advance of the actual set of iterations, using two slightly different values of the unknown initial condition. Make sure you integrate far enough out in eta to be sure you are close enough to infinity. What final value of eta are you using?

chet
 
I have some additional comments.

1. Dr. Claude is also right about the integration formula you are using. You are using a forward Euler integration, which is very inaccurate. You should be using an automatic integration package or a more accurate integration algorithm.

2. You are cutting off the integration when y' exceeds 1.0, but y' might also level off before it reaches 1.0. You need to decide on a fixed value of eta that you integrate up to, and regard that as essentially infinity. You then test the boundary condition at that location. I recommend eta = 10.

3. You know the answer to this problem before you begin. So, substitute this value in for the unknown boundary condition, as see if your integration comes close to matching the far boundary condition. This will give you a check on your coding, and also on the accuracy of your integration.

4. You need to decide on how to iterate upon the initial guess in an efficient way so that you converge rapidly to the desired solution. As I mentioned in my previous post, I recommend Newton's method (or modified Newton's method).

Chet
 
hellow everyone i need help to find the value f''(0) in blasius equation f'''+f*f''=0 or post a easy MATLAB code.
thanks
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K