Hi,
I thought that for bounce back boundary conditions yo simply assign the opposite distribution function at that boundary. But in this code i have looked at, it assigns the opposite forcing function rather than the distribution function as shown below? Can somebody explain to me why this is so?
f4(M,1:N)=F2(M,1:N);
f7(M,1:N)=F5(M,1:N);
f8(M,1:N)=F6(M,1:N);
% bottom: bounce back, no-slip
f2(1,1:N)=F4(1,1:N);
f5(1,1:N)=F7(1,1:N);
f6(1,1:N)=F8(1,1:N);
I am also having similar confusion with neumann boundary condition…
% right: Neumann
f3(1:M,N)=F1(1:M,N)-2fstar(4)/cs2(cx(4)u(1:M,N-1)+cy(4)v(1:M,N-1));
f7(1:M,N)=F5(1:M,N)-2fstar(8)/cs2(cx(8)u(1:M,N-1)+cy(8)v(1:M,N-1));
f6(1:M,N)=F8(1:M,N)-2fstar(7)/cs2(cx(7)*u(1:M,N-1)+cy(7)*v(1:M,N-1));
Thanks. James.