-
Notifications
You must be signed in to change notification settings - Fork 14
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
Correct ion charge deposition #156
Merged
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
… Safeguards preventing misuse added as well
…lse ..., thus removing duplicated code
…nt after rho depositon
SeverinDiederichs
added
component: plasma
About the plasma species
cleaning
Code cleaning, avoid duplication, better naming, better style etc.
labels
Sep 7, 2020
SeverinDiederichs
changed the title
Correct ion charge deposition
[WIP] Correct ion charge deposition
Sep 7, 2020
…effects in rho got fixed with the new implementation
SeverinDiederichs
changed the title
[WIP] Correct ion charge deposition
Correct ion charge deposition
Sep 7, 2020
SeverinDiederichs
changed the title
Correct ion charge deposition
[WIP] Correct ion charge deposition
Sep 9, 2020
SeverinDiederichs
changed the title
[WIP] Correct ion charge deposition
Correct ion charge deposition
Sep 9, 2020
MaxThevenet
approved these changes
Sep 9, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I must say I didn't check all calls to DepositCurrent
with the new bool arguments.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cleaning
Code cleaning, avoid duplication, better naming, better style etc.
component: plasma
About the plasma species
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.
This PR introduces a new way to deposit the ion charge. It resolves #122.
It depends on #155! This PR can only be merged after #155 is merged. If this one is merged first, it makes #155 redundant and it can be closed.
Previously, a uniform ion charge was assumed and simply added during the plasma current deposition.
Now, the number of slices was increased to 5, with the 5th slice being reserved for the ion charge density.
The current deposition was modified to be able to deposit the charge directly to the ion rho slice.
It was made more modular by adding boolean options which quantities to deposit (Jx + Jy, Jz, rho).
This has the advantage, that the parameter
WhichSlice::Next, This, RhoIons
now only affects in which slice something is deposited and nothing else (previously, it under the hood also managed what to deposit).This PR showed a bug with the treatment of the boundaries.
Although, the currents should be exchanged with SumBoundary, it gives the wrong result (a residual current on the edges, leading to numerical noise). Therefore, in this PR FillBoundary is added for the exchange of the currents. This needs to be addressed in a separate issue.
The benchmarks had to be updated, because spurious current deposition from the previous implementation was updated. Comparison of the lower box of rho from the following input script (the y axis label should be x, not rho)
inputs_normalized.txt
Old:
With this PR:
I do realize that rho in the slice_deposition benchmark was changed by many orders of magnitude, but this is correct. I tested it for a linear plasma wake with slice deposition and host-device and it worked fine. I would like to point out that Bz decreases by many orders of magnitude and it should be 0 for symmetric problems.
const
isconst
)