#5072
duldul
Participant

Hello Mathias.
Thank you for your kind suggestion. This papers is really nice, even I was trying to understand this paper when I saw your reply.
Recently I tried to simulate plane-Poiseuille flow and used tau = 0.53, u0 = 0.05
Boundary conditions that I used are as follows:
void boundary(int count) {
double ftemp,fq,temp;
int jj;
double t1, t2;

//Right hand Boundary (Outflow)
for ( int j = 1; j < ny-1; j++ ) {
f[nx-1][j] = 2.0*f[nx-2][j]-f[nx-3][j];
f[nx-1][j] = 2.0*f[nx-2][j]-f[nx-3][j];
f[nx-1][j] = 2.0*f[nx-2][j]-f[nx-3][j];
}//Right hand Boundary ends

//Bottom & top boundary -> bounce back
//double temp1[nx];
for ( int i = 1; i < nx-1; i++ ) {
f[i] = f[i];
f[i] = f[i];
f[i] = f[i];
//for y = ny – 1;
f[i][ny-1] = f[i][ny-1];
f[i][ny-1] = f[i][ny-1];
f[i][ny-1] = f[i][ny-1];
}//Bottom and top bounce back ends

//left hand boundary condition (inlet)
for ( int j = 1; j < ny-1; j++ ) {
u[j]=u0;v[j]=0.0;rho[j]=1.0;
t1 = u[j] * u[j] + v[j] * v[j];
for ( int k = 0; k < 9; k++ ) {
t2 = u[j] * cx[k] + v[j] * cy[k];
fq[k]= w[k] * rho[j]*(1. + 3. * t2 + 4.5 * t2 * t2 – 1.5 * t1);
}
f[j]=f[j]-fq+fq;
f[j]=0.5*(rho[j]*u[j]+rho[j]*v[j]-f[j]-f[j]+f[j]+f[j]+2.0*f[j]);
f[j]=0.5*(rho[j]*u[j]-rho[j]*v[j]-f[j]+f[j]+f[j]-f[j]+2.0*f[j]);
}
f=f;
f=f;
f=f;

f[ny-1]=f[ny-1];
f[ny-1]=f[ny-1];
f[ny-1]=f[ny-1];

f[nx-1]=f[nx-1];
f[nx-1]=f[nx-1];
f[nx-1]=f[nx-1];

f[nx-1][ny-1]=f[nx-1][ny-1];
f[nx-1][ny-1]=f[nx-1][ny-1];
f[nx-1][ny-1]=f[nx-1][ny-1];
}//boundary ends
numbering used for D2Q9 is:
514
280
637

When I run my code with the above boundary conditions after sometime velocity (or total flow rate) starts decreasing and then keeps on decreasing. Can you please guess something where I may be wrong with the conditions?

Regards
Duldul