image thumbnail
from Velocity Profile of Laminar Flow of Power Law fluid in a Pipe by Housam Binous
velocity profile of laminar flow of a power law fluid

mail_NN.m
% Author: Housam Binous

% Velocity Profile of Laminar Flow of Power Law fluid in a Pipe

% National Institute of Applied Sciences and Technology, Tunis, TUNISIA

% Email: binoushousam@yahoo.com

global kappa n rend

% Parameters for Power Law Fluid (take n>1 for dilatant fluids and n<1 for
% pseudo-plastic fluids).

title1	= 'Parameters of Power Law Fluid';

ind1	= {'kappa (1e-6)','n (2)'};

setpar	=	{'1e-6','2'};

options.resize='on';

prompt		=	ind1;
def			=	setpar;
dlgTitle	=	title1;
lineNo		=	1;

M	=	inputdlg(prompt,dlgTitle,lineNo,def,options);

if isempty(M)==0
    PAR	=	str2num(char(M));
else
    PAR=  [1e-6,2]';  
end

disp('Parameters of Power Law Fluid:')
disp(' ')
disp(PAR);    

kappa=PAR(1);
n=PAR(2);

% pipe radius is 0.02m

rend=0.02;

% finding the velocity at the center of the pipe (we use the shooting
% method)

vo=fsolve(@zero,0.5);

X0f=[0,vo];

% Solving the governing equations to get the velocity profile

[r X]=ode45(@goveq,[1e-5 rend],X0f);

% plotting the shear stress and the velocity in the pipe

figure(1);
plot(r,X(:,2),'b');
axis tight
xlabel('radial position')
ylabel('velocity')

figure(2);
plot(r,X(:,1),'r');
axis tight
xlabel('radial position')
ylabel('shear stress')

Contact us at files@mathworks.com