You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am learning LBM and looking at your code. It seems to me that your implementation of no slip wall BC is wrong.
` % Boundary Conditions
for i=1:9
f(i,bb) = f(opp(i),bb); % TODO: swap would be better. but
f(i,noslp) = f(ymr(i),noslp); % somehow MATLAB swaps automatically
end`
You had comments saying that somehow Matlab automatically swap the distribution f in opposite direction, but that is not true. For example, for direction 2 and 4, if you just loop over direction 1 to 9, then first you copy the values of those in direction 4 to direction 2, and then you copy the new values of direction 2 (which is now the values of original direction 4) to direction 4. This is not the same as "swap".
Btw, your approach of animation doesn't work for me on Matlab 2018b --- it repeats forever and pressing whitespace doesn't work.
I haven't gone till the end but I think your code is a nice reference to me. Nice work and thanks for sharing!
Best,
The text was updated successfully, but these errors were encountered:
Hi Daniel,
I am learning LBM and looking at your code. It seems to me that your implementation of no slip wall BC is wrong.
` % Boundary Conditions
You had comments saying that somehow Matlab automatically swap the distribution f in opposite direction, but that is not true. For example, for direction 2 and 4, if you just loop over direction 1 to 9, then first you copy the values of those in direction 4 to direction 2, and then you copy the new values of direction 2 (which is now the values of original direction 4) to direction 4. This is not the same as "swap".
Btw, your approach of animation doesn't work for me on Matlab 2018b --- it repeats forever and pressing whitespace doesn't work.
I haven't gone till the end but I think your code is a nice reference to me. Nice work and thanks for sharing!
Best,
The text was updated successfully, but these errors were encountered: