lbm-principles-practice / code

Code accompanying The Lattice Boltzmann Method: Principles and Practice

Home Page:http://lbmbook.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

issue in calculation of velocity u and v

dododoooo opened this issue · comments

Hi, in all codes from chapter 5 and 6 the velocity components u and v are calculated with c_i * f_i (x,t) (summation implied) while according to formula 3.1 the result should be divided by rho (x,t). Trying to add it the code doesn't give the correct result anymore.

Hi, it happens that the codes included in both these chapters (as well as the worked out examples provided in the book for these chapters) adopt the incompressible LBM model. The reason is that complexity is decreased this way, as we can get rid of compressibility errors, which is possible since we are tackling steady-state problems.

Now, if you want to re-write the codes in order to account for the standard (compressible) model then only including rho(x,y) in the momentum velocity moments is not sufficient. Besides this step, you also need to re-write the equilibrium f^(eq) accordingly (and on top of that, possibly it is also necessary to re-write the BCs and/or the force term, depending on the case you are considering).

Please, take a more attentive look at the book and the codes where these elements are explained.

Good luck.

Ah OK, I understand your question now.
Yes, the omission of rho_0 from the models in the codes is equivalent to considering it implicitly set to 1.
Note that rho_0 is an arbitrary constant, so setting it to 1 avoids the code to do extra multiplications, which are unnecessary for incompressible/linear models.
Good luck

Mr Silva, i wrote you a message on ResearchGate. Please give it a look when you'll have some time to spare.