lettucecfd / lettuce

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

refactor obstacle #116

Closed Olllom closed 2 years ago

Olllom commented 2 years ago

This PR unifies the 2D and 3D obstacle code. It also changes the constructor so that it only takes arguments in physical units.

Let me know what you think.

pep8speaks commented 2 years ago

Hello @Olllom! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 44:80: E501 line too long (118 > 79 characters) Line 46:80: E501 line too long (105 > 79 characters) Line 52:80: E501 line too long (90 > 79 characters) Line 75:80: E501 line too long (86 > 79 characters) Line 86:80: E501 line too long (83 > 79 characters) Line 94:80: E501 line too long (98 > 79 characters) Line 95:80: E501 line too long (87 > 79 characters) Line 98:80: E501 line too long (98 > 79 characters) Line 101:80: E501 line too long (112 > 79 characters) Line 102:80: E501 line too long (87 > 79 characters) Line 105:80: E501 line too long (98 > 79 characters)

Line 23:80: E501 line too long (109 > 79 characters) Line 40:80: E501 line too long (109 > 79 characters)

Line 10:80: E501 line too long (98 > 79 characters)

Line 156:80: E501 line too long (104 > 79 characters)

Comment last updated at 2022-02-01 16:38:27 UTC
Olllom commented 2 years ago

example: https://github.com/lettucecfd/lettuce/blob/obstacle/examples/obstacle.ipynb

MartinKliemank commented 2 years ago

Sorry for taking so long. Seems good to me, when #115 popped up I was also wondering, why there wasn't any option to change the characteristic length in PU. There are other parameter constellations that work (like a shape in PU, and char_len in both PU and LU which might be closest to how it is usually described in papers), however I'm not sure if any of them is better than the one you chose.

MartinKliemank commented 2 years ago

In the branch I'm on there is the Regular_Grid class, which I've been using since a year now (I'm now on the lettuceMPI_new branch, but there the class contains a lot of parallelization specific code since it was the 2nd parallelization branch). It takes shape in LU, and char_len in both LU and PU. We should probably look into if that fits this and the other flows / general implementation and possible parallelization at some point.

Olllom commented 2 years ago

@MartinKliemank OK, great. Thanks for commenting. The regular grid class looks interesting. I have a similar design in mind but I may borrow some of your code at some point.

Olllom commented 2 years ago

ok, this is ready to go on my end.