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

Investigate convergence options #1700

Closed
SouthEndMusic opened this issue Aug 8, 2024 · 1 comment
Closed

Investigate convergence options #1700

SouthEndMusic opened this issue Aug 8, 2024 · 1 comment
Labels
core Issues related to the computational core in Julia performance Relates to runtime performance or convergence

Comments

@SouthEndMusic
Copy link
Collaborator

Adding backtracking in the nonlinear solver settings (#1697) gave a huge speedup, probably because the convergence of the nonlinear solver is much faster. To get more insight into this speedup, we can look at the difference in solver stats (an output file for this was introduced in #1677).

Now that we have this speedup, we should also re-asses the other convergence measures we have in place:

  • Reduction factor (with magic hardcoded threshold values)
  • isoutofdomain. We probably want to keep this, but it's good to know whether it still being triggered sometimes

Also, we still might need this for depleting basins.

@SouthEndMusic SouthEndMusic added performance Relates to runtime performance or convergence core Issues related to the computational core in Julia labels Aug 8, 2024
@Huite
Copy link
Contributor

Huite commented Aug 9, 2024

Reduction factor (with magic hardcoded threshold values)

As I mentioned in chat, I think you're still going to need those. Even though e.g. EulerImplicit is unconditionally stable, you will either get very small time steps (with adaptive time stepping) or poor convergence (fixed time step).
To illustrate with evaporation:

$$ Q_{ET} = \begin{cases} ET * \text{area}, & \text{if } S > 0 \\ 0, & \text{if } S = 0 \end{cases} $$

Any time a droplet of water comes in, $Q_{ET}$ immediately jumps to its maximum value and depletes storage.
For extraction, it's similar to turning your pump in the dry ditch on when you see the first droplet of rain (which is why I say it's physically implausible too).

The adaptive timestepper notices this so $\Delta t \to 0 $.

Alternatively, with fixed time step it'll have trouble converging because $Q$ is switching on and off between Newton iterations.

isoutofdomain is probably good to keep around for if you want to keep the option supporting solvers with less stability guarantees?

@SnippenE SnippenE closed this as completed Sep 3, 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
Status: Done
Development

No branches or pull requests

3 participants