Answer
Given Data
Temperature of
engine Oil 100
Velocity = 0.1 m/s
Length of surface
=1 m
Temperature of that
surface= 20 
Matlab code for
boundary layer thickness
function varargout
= boundaryLayerGUI(varargin)
gui_Singleton = 1;
gui_State =
struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn',
@boundaryLayerGUI_OpeningFcn, ...
'gui_OutputFcn', @boundaryLayerGUI_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin
&& ischar(varargin{1})
gui_State.gui_Callback =
str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] =
gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
function
boundaryLayerGUI_OpeningFcn(hObject, eventdata, handles, varargin)
[X, map] = imread(fullfile(
matlabroot,'toolbox','matlab','icons','csh_icon.gif'));
icon =
ind2rgb(X,map);
uipushtool(handles.uitoolbar1,'CData',icon,...
'TooltipString','Help',...
'ClickedCallback',@AppHelp);
H = str2double(get(handles.H,'String'));
L =
str2double(get(handles.L,'String'));
set(handles.contour,'XLim',[0
L],'YLim',[0 H])
title(handles.contour,'u/U
Velocity Contour')
xlabel(handles.contour,'x
(m)'),ylabel(handles.contour,'y (m)')
set(handles.vector,'XLim',[0
L],'YLim',[0 H])
title(handles.vector,'Velocity
Profile and Boundary Layer Thickness (0.99U)')
xlabel(handles.vector,'x
(m)'),ylabel(handles.vector,'y (m)')
set(handles.strline,'XLim',[0
L],'YLim',[0 H])
title(handles.strline,'Streamlines')
xlabel(handles.strline,'x
(m)'),ylabel(handles.strline,'y (m)')
annotation(gcf,'textbox',get(handles.Re,'Position'),....
'String',{' Re_x = \rhoUx/\mu \delta_x ~= 5x/{\surd}Re_x'},...
'LineStyle','none')
handles.output =
hObject;
% Update handles
structure
guidata(hObject,
handles);
function varargout
= boundaryLayerGUI_OutputFcn(hObject, eventdata, handles)
varargout{1} =
handles.output;
function boundarylayer(handles)
rho =
str2double(get(handles.rho,'String')); % kg/m^3
U = str2double(get(handles.U,'String')); % m/s
mu =
str2double(get(handles.mu,'String')); % kg/(m*s)
nu = mu/rho; %
m^2/s
H =
str2double(get(handles.H,'String')); % m
L = str2double(get(handles.L,'String'));
% m
nx =
str2double(get(handles.nx,'String'));
ny = str2double(get(handles.ny,'String'));
dx = L/(nx-1);
dy = H/(ny-1);
[X,Y] =
meshgrid(0:dx:L,0:dy:H);
Re_L = U*L/nu;
delta_L =
5/sqrt(U/nu/L);
v = zeros(ny,nx);
u = zeros(ny,nx);
u(:,1) = U; %
Incoming
v(:,1) = 0; %
Incoming
u(1,:) = 0; %
Bottom
v(1,:) = 0; %
Bottom
u(ny,:) = U; % Top,
free stream
% March in x
direction
i = 0;
while i < nx-1
i = i+1;
for j = 2:ny-1
if j == 2
A(j) = 0;
B(j) = 2*nu/dy^2 + u(j,i)/dx;
C(j) = - nu/dy^2 + v(j,i)/2/dy;
D(j) = u(j,i)^2/dx - (- nu/dy^2 -
v(j,i)/2/dy)*u(j-1,i+1);
else if j > 2 && j < ny-1
A(j) = - nu/dy^2 - v(j,i)/2/dy;
B(j) = 2*nu/dy^2 + u(j,i)/dx;
C(j) = - nu/dy^2 + v(j,i)/2/dy;
D(j) = u(j,i)^2/dx ;
else if j == ny-1
A(j) = - nu/dy^2 - v(j,i)/2/dy;
B(j) = 2*nu/dy^2 + u(j,i)/dx;
C(j) = 0;
D(j) = u(j,i)^2/dx - (- nu/dy^2 +
v(j,i)/2/dy)*u(j+1,i+1);
end
end
usol = tdma(A(2:end),B(2:end),C(2:end),D(2:end));
u(2:ny-1,i+1) = usol;
% solve for v(j,i+1) based on known u
for j = 2:ny
v(j,i+1) = v(j-1,i+1) -
dy/2/dx*(u(j,i+1)-u(j,i)+u(j-1,i+1)-u(j-1,i));
end
end
annotation(gcf,'textbox',get(handles.Re,'Position'),...
'LineStyle','none','BackgroundColor',[0.941
0.941 0.941]);
annotation(gcf,'textbox',get(handles.Re,'Position'),....
'String',{' Re_x = \rhoUx/\mu \delta_x ~= 5x/{\surd}Re_x',...
[' Re_L = ',num2str(Re_L),' \delta_L ~=',num2str(delta_L)]},...
'LineStyle','none');
% u/U velocity
contour
set(handles.contour,'XLim',[0
L],'YLim',[0 H],'NextPlot','replacechildren');
contourf(handles.contour,X,Y,u/U,[0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.99]);
colorbar('peer',handles.contour,'SouthOutside');
set(handles.vector,'XLim',[0
L],'YLim',[0 H],'NextPlot','replacechildren');
[~,hdelta] =
contour(handles.vector,X,Y,u/U,0.99);
set(hdelta,'Color','r','LineWidth',3,'ShowText','On');hold(handles.vector,'on');
quiver(handles.vector,X,Y,u,v,'b'),hold(handles.vector,'off');
[strx,stry] = meshgrid(0,0:2*dy:H);
cla(handles.strline);
set(handles.strline,'XLim',[0
L],'YLim',[0 H],'NextPlot','replacechildren');
streamline(handles.strline,X,Y,u,v,strx,stry);
function X =
tdma(A,B,C,D)
Cp = C;
Dp = D;
n = length(A);
X = zeros(n,1);
Cp(1) = C(1)/B(1);
Dp(1) = D(1)/B(1);
for i = 2:n
Cp(i) =
C(i)/(B(i)-Cp(i-1)*A(i));
Dp(i) =
(D(i)-Dp(i-1)*A(i))/(B(i)-Cp(i-1)*A(i));
end
X(n) = Dp(n);
for i = n-1:-1:1
X(i) = Dp(i)-Cp(i)*X(i+1);
end
function
AppHelp(varargin)
dlgname = 'About
Boundary Layer App';
txt = {'Laminar
boundary layer problem solved numerically with TDMA method';
'';
'Start - Start the simulation';
'Open
Code - Open a pre-written script to show the solution code';
'';
'* Play with flow property and geometry
information to study the change';
' in
velocity profile.';
'* Use zoom, pan and data curser in the
toolbar to interact with the';
'
plots as usual';
'* Equation of boundary layer thickness
printed on the App is based on';
'
analytical solution.';
'* If Reynolds number is too high
(>500,000 for flow over flat plate),';
'
the computation is not valid, since flow becomes turbulent.';
'';
'Copyright 2013 The MathWorks, Inc.'};
helpdlg(txt,dlgname);
function
start_Callback(hObject, eventdata, handles)
boundarylayer(handles);
function
showcode_Callback(hObject, eventdata, handles)
open('boundaryLayerScript.m');
MATLAB CODE for local
value of the surface shear stress
function
[pointcld_WSS_SurfGrad] = WSS_Surface_Gradient(pointcld_norm_WSSmag_comp, NN)
ptCloud =
pointCloud(pointcld_norm_WSSmag_comp(:, 1:3));
for j =
1:1:length(pointcld_norm_WSSmag_comp)
query_point = pointcld_norm_WSSmag_comp(j,1:3);
[I] = findNearestNeighbors(ptCloud,
query_point, NN);
for i = 1:1:length(I)
ind = I(i);
dx(i) = pointcld_norm_WSSmag_comp(ind,
1) - query_point(1, 1);
dy(i) = pointcld_norm_WSSmag_comp(ind,
2) - query_point(1, 2);
dz(i) = pointcld_norm_WSSmag_comp(ind,
3) - query_point(1, 3);
dMag(i) =
pointcld_norm_WSSmag_comp(ind, 7) - pointcld_norm_WSSmag_comp(j, 7);
end
A = [dx; dy; dz]';
B = [dMag]';
X(j, :) = A\B;
alpha(j,1) = pointcld_norm_WSSmag_comp(j,8)/pointcld_norm_WSSmag_comp(j,7);
alpha(j,2) =
pointcld_norm_WSSmag_comp(j,9)/pointcld_norm_WSSmag_comp(j,7);
alpha(j,3) =
pointcld_norm_WSSmag_comp(j,10)/pointcld_norm_WSSmag_comp(j,7);
%Beta vector is the
vector normal to the direciton of flow
beta(j,:) =
cross(pointcld_norm_WSSmag_comp(j,4:6),alpha(j,:));
dTdA(j,:) =
dot(X(j,:),alpha(j,:));
dTdB(j,:) =
dot(X(j,:),beta(j,:));
WSS_SurfGrad(j) =
sqrt(dTdA(j)^2 + dTdB(j)^2);
end
pointcld_WSS_SurfGrad
= [pointcld_norm_WSSmag_comp(:,1) pointcld_norm_WSSmag_comp(:,2)...
pointcld_norm_WSSmag_comp(:,3)
WSS_SurfGrad' dTdA dTdB];
MATLAB CODE for convection
coefficient
function [ out] =
a( X,T )
out=lambda(X,T)/((cp(X,T)/Mm(X))*rho(X,T));
end
MATLAB CODE for
heat flux
[qx,qy] =
evaluateHeatFlux(thermalresults,xq,yq)
[qx,qy,qz] =
evaluateHeatFlux(thermalresults,xq,yq,zq)
[___] =
evaluateHeatFlux(thermalresults,querypoints)
[___] =
evaluateHeatFlux(___,iT)
[qx,qy] =
evaluateHeatFlux(thermalresults)
[qx,qy,qz] = evaluateHeatFlux(thermalresults)
Question
The boundary layer
associated with parallel flow over an isothermal plate may be tripped at any
x-location by using a fine wire that is stretched across the width of the
plate. Determine the value of the critical Reynolds number that is associated with the optimal location
of the trip wire from the leading edge that will result in maximum heat
transfer from the warm plate to the cool fluid. Assuming that fluid is
atmospheric air at 300K determine the distance
.
Answer
According to the
Table A from the chapter 7 of the book can be seen that


figure(1);
plot(V,Q); hold on
xlabel('V (m/s)')
ylabel('Q (W/m)')
title('Air')
end
%Saturated water
for V_w = 0.5:0.5:10
Re_w = 13824.757*V_w;
Nu_w = ((0.3)+((1.0024*Re_w^(0.5))*(1+(Re_w/282000).^(0.625)).^(0.8)));
h_w = (62.3*Nu_w);
Q_w = (0.9425*h_w);
figure(2);
plot(V_w,Q_w); hold on
xlabel('V (m/s)')
ylabel('Q (W/m)')
title('Saturated water')
end
%Engine oil
for V_e = 0.5:0.5:10
Re_e = 28.01*V_e;
Nu_e = ((0.3)+((10.015*Re_e^(0.5))*(1+(Re_e/282000).^(0.625)).^(0.8)));
h_e = (14*Nu_e);
Q_e = (0.9425*h_e);
figure(3);
plot(V_e,Q_e); hold on
xlabel('V (m/s)')
ylabel('Q (W/m)')
title('Engine oil')
end
Question
Consider a sphere
with a diameter of 20 mm and a surface temperature of 60
that is immersed in a fluid
at a temperature of 30
and a velocity of 2.5 m/s.
calculate the drag force and the heat rate when the fluid is
Water
Air at atmospheric
pressure
Answer
From the Table A of
the Chapter 7
According to that
table the property of water at 30



Answer
From a given
preheater
Condensing steam
will be at 100
Pressure will be
maintained at 1atm
And temperature =25
Length of each tube
will be equal to 10mm
According to the
Table A it can be seen that

