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

Better handling of wall boundary conditions in implicit electron timesteps #302

Merged
merged 11 commits into from
Jan 12, 2025

Conversation

johnomotani
Copy link
Collaborator

@johnomotani johnomotani commented Jan 11, 2025

  • 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 johnomotani added the enhancement New feature or request label Jan 11, 2025
@johnomotani
Copy link
Collaborator Author

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.

@johnomotani johnomotani merged commit 0d5679b into master Jan 12, 2025
19 of 21 checks passed
@johnomotani johnomotani deleted the wall-bc-Jacobian branch January 12, 2025 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant