Using ode45 to solve Vel. and Temp. profiles

  • Thread starter mejia198021
  • Start date
  • Tags
    Ode45
In summary: Pr^(1/2) * Rex^(1/2)In summary, to solve for the velocity and temperature profiles for stagnation point flow at different values of Prandtl number (Pr), you will need to use the Blasius equation, energy equation, and boundary conditions, along with a numerical solver such as ode45 in Matlab. You can then use these solutions to calculate the displacement thickness (δ), thermal boundary layer thickness (δT), skin friction coefficient (Cf(x)), Nusselt number (Nux), and mass transfer (Shx).
  • #1
mejia198021
3
0

Homework Statement


Find the velocity and temperature profiles for stagnation point flow (m=1) for various values of Pr (Pr=0.6,1,1.5,5,10)

Show that δ/δT ~Pr^0.4 by calculating δ and δT with 99% recovery of free stream velocity and temperature profiles, respectively.

Plot θ'(0) vs. Pr and compare against θ'(0)=0.5704Pr^0.4.

Also determine Cf(x) and Nux in terms of Rex and Pr.

Extend these results for the mass transfer for Shx. Where the Reynold number based on x is defined as Rex=U(x)x/v.


Homework Equations


Blasius Equation: f''' =1/2*f*f''=0
Energy Equation: 2θ''+Pr*f*θ'=0

Boundary Conditions:
At the surface (η=0):
f ' =0, f=0
θ=0 and Φ=0

Outside Boundary Layer:
(y->infin., η->infin.):
f ' -> 1,
θ->1 and Φ->1.


The Attempt at a Solution



Can anyone assist me in the findings of the velocity and temp. profiles for stagnation point flow (m=1) for Varoius values of Pr (.6,1,1.5,5,10). At this moment I am using Matlab's ode45 to solve this problem along with applying the Blasius Eqn and Energy Eqn. I have been reading on the use of ode45 and I think I know what I need to do, but I am not sure how to incorporate the above equations along with the B.C.. For this problem I might need to apply one only B.C., which would be the conditions at the surface.

Can someone please suggest any info., that would be great. Below is what I have started to solve the first part of the problem.

so far this is what I have in my M-file - this is the main part of the code:

ti=0.0;
tf=15.0;
tintval=[ti tf];
bcinit=[0.0 0.0 0.33206];

[t,y]= ode45(@stagnation,tintval,bcinit);

%t=the scalar time
%y=the column vector
%ode45 is the solver
%@rigid is the function handle calling function
%[0.0 15.0] is the time to be evaluated from ti to tf
%[0.0...etc] is the initial conditions


this next part is the function that is being called by ode45:

function df=stagnation(t,f)

dfdt = [

Of course it is not much, but that is why I need some help. Thank you
 
Physics news on Phys.org
  • #2
for your time.

Thank you for your question. In order to solve this problem, you will need to use the Blasius equation and the energy equation, along with the boundary conditions, to determine the velocity and temperature profiles for stagnation point flow at different values of Prandtl number (Pr). This can be done by using a numerical solver such as ode45 in Matlab.

First, you will need to define the Blasius equation and the energy equation in your code. The Blasius equation can be written as:

f''' = 1/2 * f * f''

And the energy equation can be written as:

2 * θ'' + Pr * f * θ' = 0

Next, you will need to define the boundary conditions. At the surface (η = 0), the boundary conditions are:

f' = 0
f = 0
θ = 0
Φ = 0

And at the outside boundary layer (y → ∞, η → ∞), the boundary conditions are:

f' → 1
θ → 1
Φ → 1

You can then use ode45 to solve for the velocity and temperature profiles at different values of Pr. The code you have written so far is a good start, but you will need to fill in the rest of the function to incorporate the Blasius and energy equations, as well as the boundary conditions.

Once you have solved for the velocity and temperature profiles, you can calculate the displacement thickness (δ) and the thermal boundary layer thickness (δT) with 99% recovery of the free stream velocity and temperature profiles, respectively. From there, you can plot θ'(0) vs. Pr and compare it to the equation θ'(0) = 0.5704Pr^0.4 to verify that δ/δT ~ Pr^0.4.

To determine the skin friction coefficient (Cf(x)) and Nusselt number (Nux) in terms of Reynolds number (Rex) and Pr, you can use the following equations:

Cf(x) = 2/Re_x * f'(0)
Nux = 0.33206 * Pr^(1/2) * Rex^(1/2)

Finally, to extend these results for mass transfer (Shx), you can use the following equation:

Shx = 0.66412 *
 
  • #3
for your time.



Thank you for your question. It seems like you are on the right track with using ode45 to solve the problem. Here are a few suggestions to help you incorporate the equations and boundary conditions into your code:

1. Define the Blasius equation and the energy equation as separate functions within your main function (stagnation). This will make it easier to call them later on.

2. Define the boundary conditions at the surface (η=0) as two separate equations within your main function. These conditions should be equal to the initial conditions (bcinit) that you defined in your ode45 call.

3. Within the main function, you can then define the equations as a system of equations, where each equation is equal to the derivative of the corresponding function. For example, your first equation would be f'' = 1/2*f*f''.

4. You can then use ode45 to solve this system of equations, passing in the function handles for the Blasius and energy equations, as well as the boundary conditions.

5. Once you have the solution, you can use it to calculate the values of δ and δT, as well as θ'(0). You can then plot θ'(0) vs. Pr and compare it to the given equation.

6. To determine Cf(x) and Nux, you can use the equations given in the homework statement and substitute in the values of Rex and Pr that you have calculated from your solution.

7. To extend these results for mass transfer, you can use the Sherwood number (Shx) equation and substitute in the values of Rex and Pr.

I hope this helps. Good luck with your code! Remember to break down the problem into smaller, manageable steps and to test your code along the way to make sure it is working correctly.
 
  • #4
for any assistance you can provide in advance.

I am happy to see that you are using ode45 to solve this problem. It is a powerful and efficient solver for differential equations. It seems like you have a good understanding of the equations and boundary conditions involved in this problem.

To incorporate the Blasius and Energy equations, you can simply add them to your function file. For example, you can define a function handle for the Blasius equation and use it in your main function file as follows:

blasius = @(f) 1/2*f*f''; % define function handle for Blasius equation
dfdt = [ % your other equations
blasius(f) % add Blasius equation to the system
];

Similarly, you can define a function handle for the Energy equation and add it in the same way.

For the boundary conditions, you can specify them in the main function file as follows:

function df=stagnation(t,f)
dfdt = [ % your equations
];
bcinit = [0.0 0.0 0.33206]; % specify initial conditions at the surface
df = [dfdt; f(1)-bcinit(1); f(2)-bcinit(2); f(3)-bcinit(3)]; % impose boundary conditions

This will ensure that your solution satisfies the boundary conditions at the surface.

To plot θ'(0) vs. Pr and compare it to the theoretical value, you can add the following code after your ode45 solver:

Pr = [0.6 1 1.5 5 10]; % specify values of Pr
theta_prime = y(:,2); % extract θ' from the solution
plot(Pr, theta_prime(1:5), 'o'); % plot θ'(0) vs. Pr
hold on
plot(Pr, 0.5704*Pr.^0.4); % plot theoretical value
xlabel('Pr');
ylabel('θ''(0)');
legend('Numerical solution', 'Theoretical value');

To determine Cf(x) and Nux in terms of Rex and Pr, you can use the following relationships:

Cf(x) = 2*f(x)
Nux = -f(x)*theta'(x)

where f(x) and theta'(x) are the solutions obtained from ode45. You can use these relationships to plot Cf(x) and Nux as a
 

Related to Using ode45 to solve Vel. and Temp. profiles

1. What is ode45 and how does it work?

Ode45 is a numerical integration algorithm used to solve ordinary differential equations (ODEs). It works by dividing the ODE into small time intervals and using a combination of fourth and fifth order Runge-Kutta methods to approximate the solution at each time step.

2. How can ode45 be used to solve velocity and temperature profiles?

Ode45 can be used to solve velocity and temperature profiles by formulating the ODEs that describe the system and providing them as input to the algorithm. This allows ode45 to calculate the velocity and temperature at each time step, providing a numerical solution for the profiles.

3. What are the advantages of using ode45 for solving profiles?

Ode45 offers several advantages for solving profiles, including its ability to handle stiff systems (where the solution changes rapidly) and its high accuracy and efficiency compared to other numerical integration methods. It also has adaptive time-stepping, meaning it can adjust the size of the time intervals to accurately capture the behavior of the system.

4. What are the limitations of using ode45?

Ode45 may not be suitable for all types of ODE systems, as it is designed for non-stiff problems. It may also have difficulty handling discontinuities or singularities in the system. In addition, ode45 requires the user to provide initial conditions and may not provide an exact solution for the ODEs.

5. How can one ensure the accuracy of the solution obtained from ode45?

To ensure the accuracy of the solution obtained from ode45, it is important to carefully choose the time step size and tolerance values. These parameters can be adjusted based on the behavior of the system and can greatly impact the accuracy of the solution. It is also recommended to compare the numerical solution with analytical or experimental results, if available, to verify the accuracy of the solution.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
5
Views
5K
  • Differential Equations
Replies
2
Views
3K
  • Introductory Physics Homework Help
Replies
1
Views
3K
  • Calculus and Beyond Homework Help
Replies
1
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
3K
  • Differential Equations
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
32K
Back
Top