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

Avoiding negative flows where they should not be #1900

Closed
SouthEndMusic opened this issue Oct 14, 2024 · 0 comments · Fixed by #1911
Closed

Avoiding negative flows where they should not be #1900

SouthEndMusic opened this issue Oct 14, 2024 · 0 comments · Fixed by #1911
Labels
core Issues related to the computational core in Julia performance Relates to runtime performance or convergence

Comments

@SouthEndMusic
Copy link
Collaborator

SouthEndMusic commented Oct 14, 2024

(Somewhat of a duplicate of #1838)

After the refactor #1819 we found that flows that should be non-negative are sometimes negative for a brief period of time (or maybe it already happened before, but we just now discovered it by looking at tracers?). I discussed this on Slack:

Image

Several solutions were proposed above depending on where the problem originates:

  • Add a stage_limiter to the nonlinear solver (@visr had some comments about this, it would be nice if you add them below)
  • Switch to QR factorization in the linear solver

If the above options don't work we could also implement a callback for enforcing non-negative flows. Some notes about this:

  • This shouldn't affect the water balance error, as it just nudges the physics in the right direction
  • This involves changing the state in the callback, which might lower the performance of multi-step methods. Also, our experiments (with @visr) with using u_modified! weren't very promising:

Image

@github-project-automation github-project-automation bot moved this to To do in Ribasim Oct 14, 2024
@visr visr added performance Relates to runtime performance or convergence core Issues related to the computational core in Julia labels Oct 15, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Ribasim Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues related to the computational core in Julia performance Relates to runtime performance or convergence
Projects
Archived in project
2 participants