CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   simplified nse in cynlinderic coordinates (matlab) (https://www.cfd-online.com/Forums/main/141753-simplified-nse-cynlinderic-coordinates-matlab.html)

mrxD September 15, 2014 12:57

simplified nse in cynlinderic coordinates (matlab)
 
hey.
my problem is
\frac{\partial u}{\partial t} =  \frac{\eta}{\rho} \frac{\partial u}{\partial r}  \frac{1}{r} +  \frac{\partial^2 u}{\partial r^2}+f(P)
with
du(0)/dr =0
u(t=0)=0
u(r)=0

u should be a profile of flow (incompressible & laminar)

f(P) is a periodic impuls of pressure.

my problem is when r=0 , u should be max. but my programm doesnt do that.
i'm using finite difference. the discretization should be okay.

Quote:

function []=inststromzy(N,om,per)
format long
ro=820;
eta=0.002;
R=0.0005;
p0=10^6;
u=zeros(N+1,1);


uavg=0;
dr=R/N;
dt=om/100;
X=[0:dr:R];
epsi=eta*dt/ro;

d = 4*ones(N+1,1);
li= -2*ones(N+1,1);
re= -2*ones(N+1,1);
li= -dr./X' + li;
re= dr./X' + re;
li(1)=-2;
A=speye(N+1)+epsi/(2*dr^2)*spdiags([li d re],-1:1,N+1,N+1);
A(N+1,N)=0;
A(N+1,N+1)=1;


v=1;

t=0;

for i=1: per



t=0;


while t < om

v=v+1;
fv(1)=0;
fv(N+1)=0;
fv(2:N-1)=-p0/ro*(exp(-2000^2*(t-1/4*om).^2));


u=A\(u-dt*fv');



figure(1)

plot(X,u)

title(['t=',num2str(t)])
axis ([0 R 0 6])
pause(0.1);

t=t+dt;



end

end


end


it would be nice,if someone could help me

thanks.


All times are GMT -4. The time now is 05:47.