MATLAB: Velocity profile for different z positions and x positions in a microchannel

codingmicrochannelpoiseuille flowvelocity profile

I need some help for this problem. I have the coding as below. How do I get the results for different z positions and x positions of velocity profile in a microchannel? The evaluated velocity field equation is referring to Bruus(2004).
{
h=100e-6;
w=100e-6;
l=50e-3;
v=2.5e-4;
z=0;
i=0;
y=0;
while(i<1000)
n = 1;
ans=0;
term=0;
while (n<1000)
a=sin(n*pi*z/h);
b=cosh(n*pi*y/h);
c=cosh(n*pi*w/(2*h));
d=(1/(n^3));
e=tanh(n*pi*w/(2*h));
f=(192*h)/((n^5)*(pi^5)*w);
g=(48*v)/(pi^3);
term=(g*d*(1-(b/c))*a)/(1-(f*e));
ans=ans+term;
n=n+2;
end
i=i+1;
result((i+1),1)=ans;
result((i+1),2)=z;
z=w/999*i;
end
xlswrite('Figure6.xlsx',result)
width = xlsread('Figure6.xlsx', 'B:B')
avevelocity = xlsread('Figure6.xlsx', 'A:A')
plot(width,avevelocity); }
I really appreciate it if someone could answer to my problem. Thank you.

Best Answer

You will have to modify your code as follows to fit the Bruus formula: {
h=100e-6;
w=100e-6;
l=50e-3;
v=2.5e-4;
z=0;
i=0;
y=0;
while(i<1000)
n = 1;
ans1=0;
ans2=0;
term1=0;
term2=0;
while (n<1000)
a=sin(n*pi*z/h);
b=cosh(n*pi*y/h);
c=cosh(n*pi*w/(2*h));
d=(1/(n^3));
e=tanh(n*pi*w/(2*h));
f=(192*h)/((n^5)*(pi^5)*w);
g=(48*v)/(pi^3);
term1=g*d*(1-b/c)*a;
term2=f*e;
ans1=ans1+term1;
ans2=ans2+term2;
n=n+2;
end
i=i+1;
result((i+1),1)=ans1/(1-ans2);
result((i+1),2)=z;
z=w/999*i;
end
xlswrite('Figure6.xlsx',result)
width = xlsread('Figure6.xlsx', 'B:B')
avevelocity = xlsread('Figure6.xlsx', 'A:A')
plot(width,avevelocity); }
Best wishes Torsten.