je-santos / MPLBM-UT

Library for performing multiphase simulations (based on the Shan-Chen model) in complicated geometries (i.e. porous media 3D images)
GNU General Public License v3.0
150 stars 58 forks source link

chopping of the image #59

Closed je-santos closed 2 years ago

je-santos commented 2 years ago

https://github.com/je-santos/MPLBM-UT/commit/5b09d027560703fbfccad00ad2ae8636e16f7040

alexgigliotti commented 2 years ago

It turns out there were two bugs:

In the palabos examples, I noticed they usually set bounce back nodes as the 0th layer and the 1st layer as the inlet. I changed this in permeability.cpp.

There was a bug in the pore_utils.py where the bounce back nodes were set prior to the slices.

Adding the bounce back nodes after padding in combination with making the inlet layer the 1st layer fixed the bug.

je-santos commented 2 years ago

Hi Alex,

So these lines here made sure that all the solid faces in the box had 1s (if there is a pore, they are re-open in the following line).

The reasoning behind this is that, if you have periodic BCs and your fluid hits a solid wall with 2s, the simulation will blow up. So its kind of important to have them

o. What's the reasoning behind this change?

alexgigliotti commented 2 years ago

Ah, I see what you mean. I spent the past couple days investigating this while making the steady state example. I reverted back to your original code and found that you need a minimum of 2 empty slices (with the inlet at slice 0) added to single phase simulations in order to converge properly. I just uploaded all the changes!

je-santos commented 2 years ago

I'm sorry that you had to go down the rabbit hole :( We have all been there