# Code flow in a channel with open boundary outlet, misbihaviour at the outlet?

Hi,
I’ve written a code of a flow in a channel with a constant inlet velocity and open boundary condition at the outlet. I got good results except that when the flow arrives at the outlet it seems like it comes back, while the condition that i implemented is simply an open boundary , so the flow should go straight at the outside not in the inside. However, after 15000 iteration the flow becomes steady and the result is perfect. So is the problem just question of waiting some time until it becomes steady?

Here is the structruce of my MATLAb code :

``````%MACROSCOPIC VARIABLES

% COLLISION STEP

%Outlet open boundary

fOut(4,out,col)=2.*fOut(4,out-1,col)-fOut(4,out-2,col);
fOut(8,out,col)=2.*fOut(8,out-1,col)-fOut(8,out-2,col);
fOut(7,out,col)=2.*fOut(7,out-1,col)-fOut(7,out-2,col);

% OBSTACLE (BOUNCE-BACK)
for i=1:9
fOut(i,bbRegion) = fIn(opp(i),bbRegion);
end

ux(bbRegion) =0;
uy(bbRegion)=0;

% STREAMING STEP

ETC
``````

I’m wondering if i placed the open boudary condition in a wrong order in the algorithm ? What’s wrong?

(Unfortunately the forum doesn’t give the opportunity to upload a screen shot to make things clearer by a n image of the flow obtained)