lbm-principles-practice / code

Code accompanying The Lattice Boltzmann Method: Principles and Practice
http://lbmbook.com
MIT License
269 stars 119 forks source link

chapter shan-chen code issue #8

Open CFDxx opened 1 year ago

CFDxx commented 1 year ago

I’m reading, learning, and rewriting your code in chapter 9 Shan-Chen model code. Since your code is one-dimensional, I want post-processing with paraview in two-dimensional, and when I rewrite your code into two dimensional it seems to give me diverge results based on the contour of density. Could you please give me any suggestions because I am really struggling at the moment? Thanks in advance.

timmkrueger commented 1 year ago

Hello! I cannot follow - the example code is actually two-dimensional. Do you mean you are trying to make it three-dimensional?

CFDxx commented 1 year ago

Thank you for your reply. I managed to figure it out. By the way, when G =-4.7 the resutls diffuse with smaller density ration, while only certain density ration is stable? Could you please give me any suggestion about setting G and denisty ratio?

timmkrueger commented 1 year ago

I'm happy to hear that. When G decreases (by magnitude), the interface gets more diffuse and the resulting density ratio also decreases. The disadvantage of the original SC method is that interface width and density ratio cannot be controlled independently since there is only one free parameter (G). You can either run a few simulations for different G values and see if you are happy with what you can achieve, or you look at the literature to find out about improvements in the SC method, such as multi-range SC.