Added NaNReporter and HighMaReporter to LettuceCFD#248
Added NaNReporter and HighMaReporter to LettuceCFD#248PhiSpel merged 22 commits intolettucecfd:masterfrom
Conversation
|
Hello @MaxBille! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-09-05 09:53:25 UTC |
shortened class definitions
adaptations of new reporter to native architecture, thx PhiSpel
pspelt is on fire... 🔥 👨💻
slightly more flexibility for step in which NaN fail occurs
PhiSpel
left a comment
There was a problem hiding this comment.
- Could you check if we need to set non_native in BreakableSimulation? If so, can you rename to
BreakableSimulationNonNative? - Maybe rename example to
FailingTGVandObstacle.py?
- renamed FailingTGVandObstacle.py - removed hardcoded non-native execution from breakable simulation class. - set Obstacle flow to non-native
|
@PhiSpel would you mind, reviewing the changes I've made, regarding your change requests and recommendation? :) (if you have the time...) |
…ed super-class, cleaner output und functionaliy
PhiSpel
left a comment
There was a problem hiding this comment.
Some comments and changes still.
A nice setup!
Please remove lettuce/ext/_reporter/nan_repoter.py (the comments still apply to lettuce/ext/_reporter/failure_reporter.py!)
Generally, please revisit the typing of inputs and outputs of the classes and functions :)
cleanup and small corrections to comments, typing and code formating
| stencil=lt.D2Q9 | ||
| ) | ||
| nan_reporter = lt.NaNReporter(100, outdir="./data/nan_reporter", vtk=True) | ||
| simulation = lt.BreakableSimulation( |
There was a problem hiding this comment.
Do the reporters only work with this specific Simulation class (i.e. BreakableSimulation)?
If not, I prefer to initialize this class within the example script (i.e. header).
There was a problem hiding this comment.
@McBs yes, it should be BreakableSimulation since we manipulate simulation.flow.i. If simulation this is not BreakableSimulation, it will continue running because call() contains a blind for-loop (
lettuce/lettuce/_simulation.py
Line 243 in d04e156
PhiSpel
left a comment
There was a problem hiding this comment.
Typing is still incomplete
Description
Closes #174
Closes #272
Adding two reporters, that check for signs of simulation crashes (NaN in f or Ma > 0.3 in u) and abort simulation with respective abort messages, optional final vtk-frame and (in case of HighMaReporter) optional output file with locations of the 100 highest velocity magnitudes for crash-troubleshooting and analysis.
NaNReporter:
HighMaReporter:
DISCLAIMER: originally written for a modified version of lettuceCFD, based on Version 0.2.3; Adaptation for new Lettuce Master pending...
Checklist