-
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
Support transient user demand return factor #1727
Conversation
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.
Looking good! You should test it by having a simple model without allocation with a transient return factor
core/test/run_models_test.jl
Outdated
@@ -395,8 +395,8 @@ end | |||
@test only(model.integrator.sol(0day)) == 1000.0 | |||
# constant UserDemand withdraws to 0.9m/900m3 | |||
@test only(model.integrator.sol(150day)) ≈ 900 atol = 5 | |||
# dynamic UserDemand withdraws to 0.5m/509m3 | |||
@test only(model.integrator.sol(180day)) ≈ 509 atol = 1 | |||
# dynamic UserDemand withdraws to 0.5m/503m3 |
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.
This is still too coarse a test. You should have a look at DataFrame(Ribasim.flow_table(model))
, and check whether the outflow to inflow proportion matches your transient return factor
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.
Timepoint at 179day show a return ratio of 0.197ish and return factor is 0.2
I made some modifications to the test model so that:
|
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.
I had one last remark, other than that this is good to if you agree with my changes.
Fixes #1230