lettucecfd / lettuce

Computational Fluid Dynamics based on PyTorch and the Lattice Boltzmann Method
MIT License
223 stars 39 forks source link

Question about grid_fine_to_coarse function #122

Closed houxianxu closed 2 years ago

houxianxu commented 2 years ago

First, thanks for this awesome Pytorch-based LBM library.

I am new to LBM and have a question about grid_fine_to_coarse function. I do not get the idea why we set the relaxation parameter as 2 * tau_coarse / tau_fine as follow: f_coarse = f_eq + 2 * tau_coarse / tau_fine * f_neq

Thanks

McBs commented 2 years ago

Hi, thanks! We are happy when people have fun with the framework! We've implemented this function for some prototyping according to Lagrava et al. 2012 (Advances in multi-domain lattice Boltzmann grid refinement). The conversion should be described in detail in this paper. Bests Mario

Olllom commented 2 years ago

Hi @houxianxu. In LBM, the equilibrium distribution does not depend on the relaxation time tau. However, the magnitude of the nonequilibrium contribution (f_neq = f - f_eq) scales with tau, which in turn depends on the resolution. That's why we need to rescale the f_neq when switching resolution. You will find the same kind of scaling in each grid refinement scheme in the LBM.

houxianxu commented 2 years ago

Thank you very much for your reply. I naively thought f_coarse was just a downsampled version of f_fine, just like we resize an image. I'm really glad to know the physics behind this operation.

All the best

Olllom commented 2 years ago

Cool. I'll close this then. Feel free to open a new issue if you have more questions.