# Extrapolation boundary conditions

Hi My name is shams,
I read a lot of things about LBM from this forum. This is very very informative side regarding to LBM problems.
Dear all i have some questions if any one like to give the answers.

1. The extrapolation boundary conditons of Guo et al.(2000). Can we apply these boundary conditions for stationary circular cylinders.
Means for the flow around a circular cylinder. Because i find that these boundary conditions recently apply for the oscillatory circular cylinders.
2. I develop a code using the incompressible Navier stokes equations proposed by Guo et al. Where no density and from the distribution function they find out the velocity components and pressure.
3. I like to post here the streaming step, some boundary conditions, inlet and outlet boundary conditions. This i write for the flow past a circular cylinder. Can any one tell me that these streaming, boundary, inlet and outlet boundary conditions are correct or not. I need a help from some one to check for me the following functions. Especially i would like Janas Lott, Morton Thomas and Orestis help me.Thanks in advance to every one.

void streaming(int wall[NX][NY], int wb[NX][NY])
{
int i,j;
for(j = 1; j <= NY-2; j++){
for( i = NX-3; i >= 0; i–) f_1[i+1][j] = f_1[i][j]; // 1-direction
for( i = 2; i <= NX-1; i++) f_1[i-1][j] = f_1[i][j]; // 3-direction
}
for(i = 1; i <= NX-2; i++){
for( j = NY-3; j >= 0; j–) f_1[i][j+1] = f_1[i][j]; // 2-direction
for( j = 2; j <= NY-1; j++) f_1[i][j-1] = f_1[i][j]; // 4-direction
}
for(j = NY-3; j >= 0; j–){
for( i = NX-3; i >= 0; i–) f_1[i+1][j+1] = f_1[i][j]; // 5-direction
for( i = 2; i <= NX-1; i++) f_1[i-1][j+1] = f_1[i][j]; // 6-direction
}
for(j = 2; j <= NY-1; j++){
for( i = 2; i <= NX-1; i++) f_1[i-1][j-1] = f_1[i][j]; // 7-direction
for( i = NX-3; i >= 0; i–) f_1[i+1][j-1] = f_1[i][j]; // 8-direction
}
}

// symmetric bc: j=1 and NY-2 is the symmetry lines.
void bc_symmetry()
{
int i;
for(i=0;i<=NX-1;i++){
f_1[i] = f_1[i];
f_1[i] = f_1[i];
f_1[i] = f_1[i];
f_1[i][NY-1] = f_1[i][NY-3];
f_1[i][NY-1] = f_1[i][NY-3];
f_1[i][NY-1] = f_1[i][NY-3];
}

//periodic boundary condition
void bc_periodic()
{
int i;
for(i=0;i<=NX-1;i++){

f_1[i] = f_1[i][NY-2];
f_1[i] = f_1[i][NY-2];
f_1[i] = f_1[i][NY-2];

f_1[i][NY-1] = f_1[i];
f_1[i][NY-1] = f_1[i];
f_1[i][NY-1] = f_1[i];
}
}

//bounce-back boundary condition for wall(channel) between 0 and 1 or between NY-2 and NY-1
void bc_bounceback()
{
int i;
for(i=0;i<=NX-2;i++){
f_1[i] = f_1[i+1];
f_1[i][NY-1] = f_1[i+1][NY-2];
}
for(i=1;i<=NX-2;i++){
f_1[i] = f_1[i];
f_1[i][NY-1] = f_1[i][NY-2];
}
for(i=2;i<=NX-1;i++){
f_1[i] = f_1[i-1];
f_1[i][NY-1] = f_1[i-1][NY-2];
}
}

void bc_inlet()
{
int i,j;
i=0; // inlet bc
for(j=1;j<=NY-2;j++) {
f_1[i][j] = f_1[i+1][j] + 6.0rho[i+1][j]w1ui;
f_1[i][j] = f_1[i+1][j+1] + 6.0
rho[i+1][j+1]w2ui;
f_1[i][j] = f_1[i+1][j-1] + 6.0*rho[i+1][j-1]w2ui;
}
}

void bc_outlet()
{
int i,j,k;
i=NX-1; // downstream bc
for(j=1;j<=NY-2;j++){
for(k=0;k<=8;k++){
// f_1[i][j][k] = 2.0*f_1[i-1][j][k] - f_1[i-2][j][k];
f_1[i][j][k] = f_1[i-1][j][k];
}
}
}

ok, i’m going to answer this one, even though i’m not on the “wish list”. the code looks good, but i feel it’s impossible to debug by just staring at it. to debug yourself simply run anyone else’s code such as these ones. then check step-by-step to see if your code finds the same results. and sure you can use guo’s boundary condition for cylinder flow. why not?