# boundarycondition in inlet and outlet

Posted by dongxueyang
 boundarycondition in inlet and outlet May 05, 2018 03:07PM Registered: 1 year ago Posts: 3
Hi,there!
Now,I am in trouble of the use of pressureboundarycondition.
I am modeling a flow with const velocity.In a box, there is one inlet, one outlet and four sidewall. About the boundarycondition, I set like this:

OnLatticeBoundaryCondition3D<T,DESCRIPTOR>* boundaryCondition = createLocalBoundaryCondition3D<T,DESCRIPTOR>();
Box3D inlet = Box3D(0 ,nx-1,0 , 0 , 0 , nz-1);
Box3D outlet = Box3D(0 ,nx-1,ny-1, ny-1, 0 , nz-1);
Box3D front = Box3D(nx-1,nx-1,1 , ny-2, 0 , nz-1);
Box3D back = Box3D(0 ,0 ,1 , ny-2, 0 , nz-1);
Box3D top = Box3D(1 ,nx-2,1 , ny-2, nz-1, nz-1);
Box3D bottom = Box3D(1 ,nx-2,1 , ny-2, 0, 0 );
boundaryCondition->setVelocityConditionOnBlockBoundaries ( *lattice, inlet, boundary::dirichlet );
boundaryCondition->setVelocityConditionOnBlockBoundaries ( *lattice, outlet, boundary::outflow );
T vy = getInletVelocity(param.inletVelocityLB, 0, param.startIter);
setBoundaryVelocity(*lattice, inlet, Array<T,3>( (T) 0,vy, (T) 0));
boundaryCondition->setVelocityConditionOnBlockBoundaries ( *lattice, bottom, boundary::freeslip );
boundaryCondition->setVelocityConditionOnBlockBoundaries ( *lattice, front, boundary::freeslip );
boundaryCondition->setVelocityConditionOnBlockBoundaries ( *lattice, back, boundary::freeslip );
boundaryCondition->setVelocityConditionOnBlockBoundaries ( *lattice, top, boundary::freeslip );
initializeAtEquilibrium( *lattice, lattice->getBoundingBox(), param.rhoLoLB, Array<T,3>( (T) 0,vx, (T) 0));
lattice->initialize();
lattice->toggleInternalStatistics(false);

The speed at the boundary advances from the entrance to the exit. After reaching the exit, the speed increases and in turn advances toward the entrance. After several cycles, the overall speed becomes larger until the calculation is wrong.
is there anyone can give me any advice?

Edited 1 time(s). Last edit at 05/05/2018 03:11PM by dongxueyang.
Sorry, you do not have permission to post/reply in this forum.