lettucecfd / lettuce

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

Porous media inquiry #97

Closed je-santos closed 2 years ago

je-santos commented 2 years ago

Dear lettucers,

Would it be feasible to run a single-phase flow through a porous medium using the current implementation?

Something like this:

https://github.com/je-santos/MPLBM-UT/tree/master/examples/singlephase_and_tortuosity_DRPcarbonate

Thanks a lot for this project, it's pretty sweet

Olllom commented 2 years ago

:-) Thanks

Yes, that's certainly feasible. I've added a prototypical notebook to a new porous branch: https://github.com/lettucecfd/lettuce/blob/porous/examples/porous_medium.ipynb

je-santos commented 2 years ago

Thank you very much for the fast turn-around. This looks great!

Olllom commented 2 years ago

No problem.

You probably have to worry a bit about defining the units correctly. I am not super familiar with porous media - so what I've put into the notebook is pretty ad hoc to just get a minimal example to run.

We usually define Ma and Re. In an incompressible setting, Ma is a purely numerical parameter. But you need to probably define your lattice unit system from the pressure drop.

If you happen to work out a more sophisticated version of this flow, please share - I'd be happy to merge a version with consistent units, permeability computation, etc. into our master branch :-)

je-santos commented 2 years ago

I am happy to provide an example to the community. I'm wondering, in your experience, what would be the maximum domain size that lettuce could work on in a standard GPU (let's say 24 Gb)?

Olllom commented 2 years ago

2D or 3D?

je-santos commented 2 years ago

I am mainly interested in 3D flows. But it would be useful to know the limitations of both.

On Fri, Dec 3, 2021 at 8:11 AM Andreas Krämer @.***> wrote:

2D or 3D?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lettucecfd/lettuce/issues/97#issuecomment-985597726, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBKSO2VAPHJXTBYD6JR3TTUPDMY5ANCNFSM5JIMC35A .

-- Javier E. Santos Graduate Research Assistant and Digital Rock Curator The University of Texas at Austin GoogleScholar https://scholar.google.com/citations?user=NxRn0-IAAAAJ&hl=en&authuser=1 | ResearchGate https://www.researchgate.net/profile/Javier-E-Santos | LinkedIn https://www.linkedin.com/in/je-santos | GitHub https://github.com/je-santos

Olllom commented 2 years ago

I am not entirely sure but in 3D it's quite limited (we have a prototypical MPI implementation though that is not part of the main branch, yet).

In 2D I can do resolutions of ~5000x10000 in double precision on my 24GB card.

@McBs do you know the exact limitations in 3D?

Olllom commented 2 years ago

@MartinKliemank what resolution/#GPUs did you run with your house stuff?

McBs commented 2 years ago

Hey, if I simulate a basic flow (TGV3D) using D3Q27 without any reporter or boundary masks, I can use a resolution of ~220³ in single precision ~170³ in double precision on my RTX2070S (8GB)

As Olllom already mentioned, we are currently working on an MPI implementation to handle this bottleneck)

je-santos commented 2 years ago

This is pretty good. Do you run into any problems when simulating on single precision? I'm guessing that half precision won't work, but I can try.

Thanks a lot to both of you for your responses. This is very helpful.

Olllom commented 2 years ago

Half precision is complete garbage for LBM. In my experience, single precision is not very reliable either. But I've mostly looked at high-Re flows.

MartinKliemank commented 2 years ago

Sorry, I didn't see your messages yesterday. My house stuff was single precision 360 240 180 on one V100 (I think 16 GB) but using the KBC collision model, which currently uses a lot more RAM than BGK