CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

start-up flow poiseuille w/finite difference

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 12, 2010, 14:23
Default start-up flow poiseuille w/finite difference
  #1
New Member
 
Peter
Join Date: Oct 2010
Posts: 1
Rep Power: 0
piper10 is on a distinguished road
hello,
I'd appreciate if someone with matlab knowledge could help me.
I'm trying to solve the above mentioned pde in matlab.

I have the following code:

clear;clc;
h = 1;
dr = 0.01; dt = 0.01;
nmax = 4000; epsilon = 0.0001;
r = [0:dr:h];
t = [0:dt:h];
beta=0.1;
n1 = fix(h/Dr)+1;
m1 = fix(h/Dt)+1;
% Initialize solution matrices
velocity = zeros(n1,m1)
velocityN =velocity
% Iterative process for the solution
for k = 1:nmax
% boundary conditions:
velocityN(:,n1) = zeros(n1,1);

% Calculate velocityN in interior points
for i = 2:n1-1
for j = 1:m1
velocityN(i,j+1)= (beta*(1-(1/(2*i)))*velocity(i-1,j)+(1-2*beta)*velocity(i,j)+beta*(1+1/(2*i))*velocity(i+1,j));
end;
end;
% Check convergence
nfail = 0;
for i = 1:n1
for j = 1:m1
if abs(velocityN(i,j)-velocity(i,j))>epsilon
nfail = nfail+1;
end;
end;
end;

if nfail > 0
velocity = velocityN;
else
return;
end;
end;
fprintf('No convergence after %i iterations.',k);
[X,Y] = meshgrid(r,t);
contour(X,Y,velocity',10)

however, for r=0 I have dv/dr=0 as the second boundary condition.

How do I incorporate this into the program.
dV/dr should be:
velocityN(0,j+1)=((1-4*beta)*velocity(0,j)+4*beta(velocity(1,j)))

Same with the initial condition say a constant 10 atm/cm is applied at t=0

thanks

Last edited by piper10; October 12, 2010 at 14:40.
piper10 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Flow meter Design CD adapco Group Marketing Siemens 3 June 21, 2011 08:33
Boundary condition and Poiseuille flow simulation Cyp OpenFOAM 6 March 11, 2011 14:53
Difference between microflows and normal flow MARK Main CFD Forum 3 March 30, 2008 13:35
Difference between thermal and flow analysis Ajmal FLUENT 0 December 8, 2007 08:03
Basic Poiseuille flow simulation question Ashish Main CFD Forum 0 October 2, 2007 13:05


All times are GMT -4. The time now is 00:25.