-
Notifications
You must be signed in to change notification settings - Fork 22
fix: need max_step in solve_ivp to get accurate dry density profile like in PySDM example #649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #649 +/- ##
==========================================
+ Coverage 92.93% 98.39% +5.46%
==========================================
Files 40 9 -31
Lines 1754 187 -1567
==========================================
- Hits 1630 184 -1446
+ Misses 124 3 -121 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
thanks @yoctoyotta1024 ! |
Hard to say what the test could be, but the issue is that without max_step the dry density profile is slightly different compared to the PySDM Shipway_and_Hill_2012 example (see plot here). This matters for the pressure and density and therefore condensation in the example (because they're so sensitive to the density profile). (note mislabeled units should read kg/m^3) |
|
Thanks! The code generating this plot is a perfect test! Please add it into this PR, and we can work to shape it into a unit test. |
Oh the code I ran to make the plot is very dirty and actually an extract from my superdrops-in-action repository (i.e. not PyMPDATA directly). But all I did was add a flag to the Shipway_and_Hill_2012 settings in PyMPDATA which turns on/off the use of a max_step in solve_ivp for the dry density. Let me just do that more neatly and get back to you. |
|
I can't reproduce he plot with PyMPDATA because using |

see: https://github.com/open-atmos/PySDM/blob/e22f01ea1f4a5272965b0867e7104f1fc5dd101b/examples/PySDM_examples/Shipway_and_Hill_2012/settings.py#L142