-
Notifications
You must be signed in to change notification settings - Fork 5
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
Let solver integrate flows #1444
Conversation
There seems to be something broken in adaptive timestepping. It looks like timesteps are allowed to be arbitrarily small (no matter the solver settings), which would explain why running the Edit: this has now been resolved. I think the state-specific tolerances in Lines 14 to 15 in 79aa2df
It also looks like that comment is outdated, because you don't give a negative |
It doesn't look outdated to me. First you update to t=dt0, then to t=dt2/0, which is before the current t. The SciML methods expect a dt argument, whereas BMI expects a t argument. |
# Only have finite tolerance on storage states | ||
abstol = copy(u0) | ||
reltol = copy(u0) | ||
abstol .= Inf | ||
reltol .= Inf | ||
abstol.storage .= config.solver.abstol | ||
reltol.storage .= config.solver.reltol | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If desired, we could apply different tolerances to different components of the states this way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, though the "mean_flow" test perhaps needs some double checking to see if it is ok. A flow of 0.84 where it should be 1 seems quite a large difference, though if it is only for tiny dt and evens out properly over time it should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't comment on the solver changes/setup, but overall looks ok to me, some small comments.
FWIW I would be useful for others to have a nice PR description (which turns into a commit message after (squash) merging) at least detailing what changed in the internal API for other developers who didn't see these changes.
Also, this seems a net change in terms of lines added/removed, contrary to the original idea in #1431. Do we think this lowered our maintenance? How is the performance affected? |
So it turns out that this is pretty bad for performance, it basically negates all performance gain from #1457 as measured with the HWS model. So here's a wild idea: What if we set up a parallel ODE problem for the flow integration with an explicit solver? |
Too bad this didn't work out performance wise, good effort though. |
Fixes #1431.
To do: