Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

please include matlab code The convective heat transfer problem of cold oil (Pr

ID: 3278385 • Letter: P

Question

please include matlab code

The convective heat transfer problem of cold oil (Pr > 10) flowing over a hot surface can be described by the following second-order ordinary differential equations. d^2T/dx^2 + Pr/2 (0.332/2 x^2) dT/dx = 0 where T is the dimensionless temperature, x is the dimensionless similarity variable, and Pr is called number, a dimensionless group that represents the fluid thermos-fluid properties. For oils, Pr = 10 - 1000, depending on the kinds of oils. This problem is a boundary-value problem with the two conditions given on the wall (x = 0) and in the fluid far away from the wall (e.g., x = 5). You are asked to use the shooting method to solve this problem by employing the MATLAB functions such as ode45 and fzero: Setup a function file, [dy] = dT dx(x, T, Pr), so you can solve this second-order differential by solve two first-order ordinary differential equations. Note that Pr is a parameter that can be assigned any values. Convert the present boundary-value problem to a root-finding problem that is solved with MATLAB fzero. Plot the variation of dimensionless temperature T as a function of x for equations. four values of Pr: 10, 100, 200, 500.

Explanation / Answer

function F=deriv(b)

x=[0 0 b(1) 1 b(2)];

[t,y]=ode15s(@freeconv,[0 5],x0);

%Split boundary condition problem

F(1)=y(end,2);
F(2)=y(end,4)^2+y(end,5)^2;

function F=deriv1(b)

x0=[0 0 b(1) 1 b(2)];

[t,y]=ode15s(@freeconv,[0 100],x0);

%Split boundary condition problem

F(1)=y(end,2);
F(2)=y(end,4)^2+y(end,5)^2;

function x_dot=conv(t,x)

global Pr

x_dot(1)=x(2);
x_dot(2)=x(3);
x_dot(3)=-3*x(1)*x(3)+2*x(2)^2-x(4);
x_dot(4)=x(5);
x_dot(5)=-3*Pr*x(1)*x(5);

x_dot=x_dot';

global Pr

% Prandtl number is Pr

% figure 1 gives velocity profile

% figure 2 gives temperature profile

% Determine the boundary conditions at the surface using outer fluid conditions using
% fsolve b

Pr=1

option=optimset('TolFun',1e-6,'TolX',1e-6);
b=fsolve(@deriv,[0.5 -0.6],option);

b

x0=[0 0 b(1) 1 b(2)];
[t,y]=ode15s(@conv,[0 5],x0);
figure(1);
plot(t,y(:,2),'r')
hold on
figure(2);
plot(t,y(:,4),'r')
hold on

Pr=100

option=optimset('TolFun',1e-6,'TolX',1e-6);
b=fsolve(@deriv,[0.25 -2.0],option);

b

x0=[0 0 b(1) 1 b(2)];
[t,y]=ode15s(@conv,[0 5],x0);
figure(1);
plot(t,y(:,2),'b')
figure(2);
plot(t,y(:,4),'b')

Pr=10
option=optimset('TolFun',1e-6,'TolX',1e-6);
b=fsolve(@deriv,[1 -1],option);

b

x0=[0 0 b(1) 1 b(2)];
[t,y]=ode15s(@conv,[0 5],x0);
figure(1);
plot(t,y(:,2),'g')
figure(2);
plot(t,y(:,4),'g')

Pr=0.01

option=optimset('TolFun',1e-6,'TolX',1e-6);
b=fsolve(@deriv1,[1 -0.05],option);

b

x0=[0 0 b(1) 1 b(2)];
[t,y]=ode15s(@conv,[0 5],x0);
figure(1);
plot(t,y(:,2),'y')
figure(2);
plot(t,y(:,4),'y')