Skip to content
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

More accurate interpolation #314

Merged
merged 2 commits into from
Jun 19, 2023
Merged

More accurate interpolation #314

merged 2 commits into from
Jun 19, 2023

Conversation

SouthEndMusic
Copy link
Collaborator

@SouthEndMusic SouthEndMusic commented Jun 14, 2023

I have implemented the physical interpolation (as proposed in #225). I have not checked whether this implementation is exactly what we want for extrapolation (#279), but this implementation assumes that the storage is 0 at the lowest level and does linear extrapolation of the area as a function of the level based on the last 2 values.

This does not solve the problem of high oscillating flows produced by the ManningResistance node as hoped (#80). I think the problem there is that the calculated flows are way to large, and therefore the equilibrium is overshooted at every time step.

I cannot wrap my head around the current ManningResistance implementation. I understand that flow occurs due to a difference in level, but I do not understand why that means that all the water comes in motion, not just the bit at the top (which is why I find LinearResistance more intuitive). Is anyone familiar with a ManningResistance being used for flow that can go both directions, or is it only used for flow that goes one direction due to gravity? In that last case I understand better why all water is in motion.

Also, the current implementation assumes the presence of a lot of water in the channel itself, which fluctuates with the level in the upstream basin with no regard for (local) water preservation (by which I do not mean that the ManningResistance node is not preserving but it is less physical).

@SouthEndMusic SouthEndMusic requested a review from visr June 14, 2023 13:41
@SouthEndMusic SouthEndMusic marked this pull request as draft June 14, 2023 13:41
@SouthEndMusic SouthEndMusic changed the title More accurate interpolation and ManningResistance More accurate interpolation Jun 15, 2023
@SouthEndMusic
Copy link
Collaborator Author

I restricted this PR to the profile interpolation since fixing the ManningResistance turns out to be a separate problem.

@SouthEndMusic SouthEndMusic marked this pull request as ready for review June 15, 2023 09:36
@SouthEndMusic SouthEndMusic requested review from evetion and Huite June 15, 2023 09:36
Copy link
Member

@visr visr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me overall, I left some comments. Let's add some tests for get_area_and_level. For that I think you can create a Basin directly (not an entire test model), and then make sure you check all 3 main branches, including the area_diff 0 branches.

core/src/utils.jl Outdated Show resolved Hide resolved
core/src/utils.jl Outdated Show resolved Hide resolved
core/src/utils.jl Outdated Show resolved Hide resolved
core/src/utils.jl Outdated Show resolved Hide resolved
core/src/utils.jl Outdated Show resolved Hide resolved
@SouthEndMusic SouthEndMusic requested a review from visr June 16, 2023 14:19
@visr visr self-assigned this Jun 19, 2023
@visr visr force-pushed the ProperInterpolation branch from ff7cbaf to a4c5d9c Compare June 19, 2023 15:10
@visr visr merged commit dcb9ac7 into main Jun 19, 2023
@visr visr deleted the ProperInterpolation branch June 19, 2023 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants