image thumbnail
from Velocity Profile of Laminar Flow of Carreau fluid in a Pipe by Housam Binous
computes velocity profile of Carreau fluid in a pipe

mail_NN.m
% Author: Housam Binous

% Velocity Profile of Laminar Flow of Carreau fluid in a Pipe

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

% Email: binoushousam@yahoo.com

global lamda n nu0 nuI rend

% Parameters for Carreau Fluid

title1	= 'Parameters of Carreau Fluid';

ind1	= {'n (0.5)','lamda (0.2)','nu0 (1.72775e-3)','nuI (0)'};

setpar	=	{'0.5','0.2','1.72775e-3','0'};

options.resize='on';

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

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

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

disp('Parameters of Carreau Fluid:')
disp(' ')
disp(PAR);    

n=PAR(1);
lamda=PAR(2);
nu0=PAR(3);
nuI=PAR(4);

% 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.2);

X0f=[0,vo,nu0];

% Solving the governing equations to get the velocity profile

opts = odeset('Mass','M','MassSingular','yes');

[r,X]=ode15s('goveq',[1e-5 rend],X0f,opts);

% 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