# Boundary conditions

Hi Dear All,
I post here some boundary conditions like (periodic boundary, symmetry boundary and bounceback boundary conditions). I writte these boundary condtions for the flow past a circular cylinder. I need some suggestions from any one that the way that i write these boundary conditions it’s correct or not (i mean can i do some mistake in such a coding). Thanks in advance

// 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] = f_1[i];
// f_1[i] = f_1[i];
// f_1[i] = f_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];
``````

// 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];
// 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];
}
}