-
Notifications
You must be signed in to change notification settings - Fork 4
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
Better handling of wall boundary conditions in implicit electron timesteps #302
Merged
Conversation
This file contains 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
Collaborator
johnomotani
commented
Jan 11, 2025
•
edited
Loading
edited
- The
$v_\mathrm{cut}$ specifying the beginning of the tail of the electron distribution function that is lost to the wall is recalculated at each Newton iteration in the electron implicit timestep. However, the constraints are not enforced as they would be when imposing the full boundary condition (as 'hard forcing' of constraints interferes with the convergence of the Newton-Krylov iteration).- This seems to significantly enhance the robustness of the electron implicit timesteps.
- Adds the contribution of the wall boundary condition in the function that calculates the electron Jacobian matrix.
- Not thoroughly tested yet, but initial indications are that this addition helps a little in increasing the electron timestep and/or reducing the number of iterations, but on the level of ~10-20%.
...for electrons. Separate out the calculations into separate functions, which will be reused when calculating the contribution of the wall boundary condition to the Jacobian matrix.
The boundary condition matrix should be added to the Jacobian so that it acts as a constraint setting the boundary points equal to the values they would have due to the boundary condition. This can be arranged by setting the RHS equal to zero, and the rows of the Jacobian corresponding to the boundary points to (I - M_wall), where I is the identity and M_wall is the matrix that would generate the perturbations of the boundary points given the perturbations of the state vector.
The response to changes in electron_ppar is very different at the last non-zero grid point before vcut than at nearby grid points. A preconditioner calculated when that grid point was in a different place will be a bad preconditioner. Recalculate the preconditioner whenever that grid point changes (at any r-index).
Adding the wall boundary condition to the preconditioner matrix (at least in the form implemented so far) does not seem to speed up convergence significantly, so make it a feature that can be optionally enabled.
Includes inputs for runs both with and without wall boundary conditions included in the Jacobian matrix.
johnomotani
force-pushed
the
wall-bc-Jacobian
branch
from
January 11, 2025 15:29
510626c
to
8200b01
Compare
Parallel tests are failing in the kinetic electron test with ADI preconditioner, on 2 cores. I'm not sure why, and I can't reproduce the error on my laptop. The test failure seems to have gone away in #303, so I'm going to ignore it and hope it was not a real problem. |
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.