270 efficient hwbb and ibb#287
Conversation
…aster. including: obstacle_cylinder.py, example-Simulation-script, HWBB and IBB boundary conditions, MEA for Bounce back boundaries, drag and lift observables...
…aster. including: obstacle_cylinder.py, example-Simulation-script, HWBB and IBB boundary conditions, MEA for Bounce back boundaries, drag and lift observables...
… 270-efficient_hwbb_and_ibb
…ed from MP2 and MA). obstacle_cylinder.py implements the flow, the boundary classes are implemented in the respective files under /_boundary WorkInProgress, see ToDOs
…ack boundaries to folder examples/advanced_projects/efficient_bounce_back_obstacle. Includes boundary conditions, obstacle_cylinder.py and placeholders for simulation-scripts for Re40-300 and Re3900, and a jupyter-notebook to run the scripts interactively _simulation.py: added comments for clarification
…pare to MP2 and cylinder2025 results!
|
@PhiSpel @McBs README:
|
examples/advanced_projects/efficient_bounce_back_obstacle/fullway_bounce_back_boundary.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
@MaxBille nice job so far!
Could you
- Mirror the folder structure of /lettuce/.. for any files which are non-executables? (
Flow/obstacle_cylinder.py,Boundary/solid_boundary_data.py,boundary/linear_interpolated_bounce_back_boundary.py, etc.). This will make it easier to review and to later merge into the corresponding structure withinlettuce/ - Typo:
parameterizeshould beparametrize - Remove all lines containing
OLD - change default arguments to the values you suggested above
- since TODOs are already here as issues, you could remove those lines
- Do you need
torch.autograd? - Since you are using so many args, this could be useful to save all the overloads into local variables (should be simple enough to refactor): https://docs.python.org/3/library/argparse.html#the-namespace-object
- Remove redundant
if Truehttps://github.com/MaxBille/lettuce/blob/ea1705f8bce28146723efd2359d8f9ba8b81b185/examples/advanced_projects/efficient_bounce_back_obstacle/01a_script_cylinder_lowRe.py#L279 - Since you have so much input-parsing, wouldn't it make sense to create a separate file / function for this?
- I like the idea of saving the output in the Jupyter notebook. However, it is currently a bit out of place. I'd suggest naming only master-files
xy_[...]. So, if we keep the notebooks, move the scripts into a subfolder. That could look quite nice, too. - I do not get the last lines of
01a[...]. Could you move those comments to the corresponding lines of code or into the file head? https://github.com/MaxBille/lettuce/blob/ea1705f8bce28146723efd2359d8f9ba8b81b185/examples/advanced_projects/efficient_bounce_back_obstacle/01a_script_cylinder_lowRe.py#L320C3-L320C10
examples/advanced_projects/efficient_bounce_back_obstacle/auxiliary_code/helperCode.py
Show resolved
Hide resolved
...advanced_projects/efficient_bounce_back_obstacle/linear_interpolated_bounce_back_boundary.py
Outdated
Show resolved
Hide resolved
...advanced_projects/efficient_bounce_back_obstacle/linear_interpolated_bounce_back_boundary.py
Outdated
Show resolved
Hide resolved
...advanced_projects/efficient_bounce_back_obstacle/linear_interpolated_bounce_back_boundary.py
Outdated
Show resolved
Hide resolved
...advanced_projects/efficient_bounce_back_obstacle/linear_interpolated_bounce_back_boundary.py
Outdated
Show resolved
Hide resolved
examples/advanced_projects/efficient_bounce_back_obstacle/obstacle_cylinder.py
Outdated
Show resolved
Hide resolved
examples/advanced_projects/efficient_bounce_back_obstacle/obstacle_cylinder.py
Outdated
Show resolved
Hide resolved
examples/advanced_projects/efficient_bounce_back_obstacle/obstacle_cylinder.py
Outdated
Show resolved
Hide resolved
examples/advanced_projects/efficient_bounce_back_obstacle/obstacle_cylinder.py
Outdated
Show resolved
Hide resolved
…ample to validate against MP2 and cylinder-paper data; to be tested...
- comments - print-statements - ToDos - revert changes in .ipynbs (less clutter in later PR)
…to fork/MaxBille/270-efficient_hwbb_and_ibb
…numerically there are diffs. of ~1% in mean Drag... this might be due to the new pre/ost-boundary strategy of lettuce 2025. Needs further investigation (issue already open). Further improvements and corrections: - implemented lateral walls option (for FWBB) - removed some comments and old code sections. NEXT will be output/data/vtk cleaning and example .ipynb script for execution
- methods for force coefficient plotting and analysis were outsourced to data_processing_and_plotting.py - files for NaN-, HighMa-, and Progress-Reporter created (but work in progress)
…to 270-efficient_hwbb_and_ibb
examples/advanced_projects/efficient_bounce_back_obstacle/reporter/reporter_ProfileReporter.py
Show resolved
Hide resolved
examples/advanced_projects/efficient_bounce_back_obstacle/reporter_advanced_vtk_reporter.py
Outdated
Show resolved
Hide resolved
…ng, before next review cycle
|
@McBs PR is ready for review. @PhiSpel I applied most of your change-requests from Nov 26, 26
|
@MaxBille should I create issues for these points for you to do later, or is this outside of your capacities? |
Doing this is out of my capacities, because of other priorities. Do you want to write an issue for these, or should I do that? |
…th master branch (2)
PhiSpel
left a comment
There was a problem hiding this comment.
lgtm, congratulations!!! 😃
Description
(ready for review)
Associated to issue #270 and related to feature requests #271 , #273 . See respective issue descriptions.
Checklist
__init__examples/advanced_flows/orexamples/simple_flows/tests/edit Philipp: won't add a test for these, since it's part of the advanced examples and not yet part of the lettuce core
relevant files and changes
examples/advanced_projects/efficient_bounce_back_obstacle/00_run_parameterized_project.ipynbwith two examples of parametrized calls of the main simulation-script to run:/profile_reference_data). This data is loaded and plotted, by the respective functionalities inauxiliary_code/data_processing_and_plotting.py.01_script_cylinder_simulation.pycontains:simulation()additions and changes in lettuce-code:
ebb_simulation.pythat improves the regular simulation class to use post-streaming boundaries and let boundaries get post-collision but pre-streaming information on populations, needed for their bounce back algorithm (for HWBB and IBB).obstacle_cylinder.py: advanced obstacle flow with a symmetrically placed circular cylinder in 2D or 3D that can be run with periodic or solid boundary channel walls and efficient bounce back boundaries for the solid cylinder itself.nice-to-knows and further features:
solid_boundary_dataclass enables unified and efficient containment of bounce back data (masks, population-indices, interpolation-constants,...)data_processing_and_plotting.pyutility.data_processing_and_plotting.pyutility. Gives statistics and frequency of a periodic signal (used for drag and lift in this project)VTKsliceReporterallows easy capture of 2D-slices for efficient visualization.data_processing_and_plotting.pyutility. It allows the loading of reference data, processing of profile reporter data and plotting of both.