jviquerat / lbm

A simple full-python 2D lattice-boltzmann code
MIT License
153 stars 26 forks source link

BB versus IBB #7

Closed jviquerat closed 4 years ago

jviquerat commented 4 years ago

Hi @2b-t,

A small update on IBB, using the "best" interpolation proposed by Bouzidi et. al. For now I am considering a square in a channel at Re=20. The channel is larger than my previous case, as I was wondering wether the large gradients above and below the obstacle could be a problem for the LB to resolve. I computed a reference value for drag and lift using a very refined Fenics computation. Things seem a bit better with IBB, although it makes no wonder, at least in this case. It could be due to this specific case, as the measured lift is very low.

On the drag, IBB is barely better than BB (it's a zoom on the end of the graph):

drag_ibb_bb_square_zoom

On the lift, we can see a difference, as BB lift does not improve when refining. Still, it seems hard to explain the differences between BB and IBB for ny=100.

lift_ibb_bb_square

The domain is voluntarily short to limit computational time, but I did the same for the Fenics computation.

u_norm_164

2b-t commented 4 years ago

Hmmm, I am a bit confused. So are all results above obtained with a square cylinder? Shouldn't there be any difference between the two for a square cylinder? After all there is no stair-casing necessary.

jviquerat commented 4 years ago

Sorry, I did not detail the content of my plots enough :( The figure in the legend of each plot corresponds the the refinement (ie nb of lattice cells in the y direction).

jviquerat commented 4 years ago

Oops, I made something wrong and deleted one of your comments :S sorry about that.

2b-t commented 4 years ago

No, I deleted them, that with Reynolds was a typo.

2b-t commented 4 years ago

I replied too early without thinking so I deleted them briefly afterwards. Are the results for a square cylinder? Shouldn't there be no difference between the two as there is no stair-casing involved?

jviquerat commented 4 years ago

From what I understood, IBB has an impact on stair-casing discretization, but it must also partially fix the problem of the exact position of the interface. Even without staircasing, the position of the exact interface using BB is inaccurate (the maximal error distance lying somewhere between dx/2 and dx, depending on how one sets the lattice cell to solid or fluid, I guess). Does that make sense to you ?

2b-t commented 4 years ago

Normally the wall position is viscosity dependent with BGK but with TRT it is not and you can use the magic parameter to fix the position so it does not change in between simulations (because if you do not use diffusive scaling it does as the relaxation time changes!). So normally I would not expect TRT to show such behaviour and would not image the difference would be that big. BGK and TRT in my simulations as far as I can remember resulted in almost identical forces with bounce-back.

If you look at the mathematical formulation for a wall exactly located in between the two nodes (meaning p = self.obstacles[obs].ibb[k] should equal to 0.5), then the mathematical formula for interpolated bounce-back degenerates to simple bounce-back. This should be the case for a square cylinder meaning bounce-back and interpolated bounce-back should mathematically result in the same formula and yield the same results. If your graphs belong to a square cylinder then I assume either p is not set to 0.5 (meaning the geometry you simulate is slightly smaller or bigger) or there is a programming mistake somewhere (might also be the corners). I would in any case test if p=0.5 results in the same results as simple bounce-back.

jviquerat commented 4 years ago

Hi @2b-t :)

Well, I cannot say. I tested IBB with q=0.5, and I indeed obtain the same solution as with BB. Then, I did the same test again (IBB vs BB, different levels of refinement, comparing with very fine FEM solution), but putting the square lower in the channel, to generate more lift :

lift_square

It seems like the BB converges to a different value (I guess), while the IBB converges to the reference value. I will make a few more tests on other non-trivial shapes to see what I obtain.

2b-t commented 4 years ago

Hey @jviquerat, how is it going? Sorry for answering so late, I have been a bit busy the last two days and completely forgot about answering.

Converging to different values for a q other than 0.5 does not seem implausible in my opinion as the simulated geometry is slightly different between the simulations (staircasing and size) but is nonetheless nothing I would have expected to that extend at least. The thing that really surprises me though and I can't find a good explanation for is that the curve for IBB and a resultion of 100 lattices is significantly worse than simple BB. The only explanation I can come up with is that the resolution might be too coarse for the interpolation used in the IBB. Let me know if you have any idea about what might cause this behaviour...

jviquerat commented 4 years ago

@2b-t No I have no idea. Might be that the channel configuration introduces too-steep gradients above and below the shape, causing the IBB not to perform well. I will clean and commit the code as it runs best now, and I will come back to it later I think ;)

If you ever feel like giving it a look, feel free to re-open an issue ;)

2b-t commented 4 years ago

@jviquerat I will have a look this weekend. :) In case I see something I will re-open an issue. I think you can close this one as well!

jviquerat commented 4 years ago

Great ;)