Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Issues with the code #1

Open
henry2004y opened this issue Apr 13, 2019 · 0 comments
Open

Some Issues with the code #1

henry2004y opened this issue Apr 13, 2019 · 0 comments

Comments

@henry2004y
Copy link

henry2004y commented Apr 13, 2019

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

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant