Conversation
Copy-paste error in calculation of neighboring timesteps.
Modify dt_vec PETSc Vec, pseudo_timestep Field3D and pseudo_alpha on SNES failure. When dt_vec was modified but pseudo_alpha was not, the PID controller would become saturated so that timestep increases were determined by caps on increases.
| } else { | ||
| // Log squash | ||
| // dt_vec <- timestep * (dt_vec / timestep)^lambda | ||
| PetscInt size; |
Contributor
There was a problem hiding this comment.
warning: variable 'size' is not initialized [cppcoreguidelines-init-variables]
src/solver/impls/snes/snes.cxx:1049:
- ;
+ = 0;| } | ||
|
|
||
| // Anti-windup: Calculate the effective alpha parameter | ||
| Field3D pseudo_alpha_effective = local_residual * pseudo_timestep; |
Contributor
There was a problem hiding this comment.
warning: variable 'pseudo_alpha_effective' of type 'Field3D' can be declared 'const' [misc-const-correctness]
Suggested change
| Field3D pseudo_alpha_effective = local_residual * pseudo_timestep; | |
| rconst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
min_neighboring_dt. This is used to cap the cell-to-cell variation of timesteps.