Add Plasma Histogram Diagnostic#1357
Open
AlexanderSinn wants to merge 23 commits into
Open
Conversation
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.
This PR adds a histogram diagnostic type that allows the creation of arbitrary 1D and 2D histograms of beam and plasma species.
Documentation:
This diagnostic allows the direct computation of histograms of arbitrary particle
quantities during the simulation runtime. It supports both plasma and beam particles.
It is part of the standard field diagnostic and is enabled by setting
<diag name>.base_geometry = histogram. Histograms may have one or two user-defined axes.Optionally, the simulation z-axis can be included as an additional axis or integrated over.
All field diagnostic parameters apply, except
field_dataanddiag_type.For example,
patch_loandpatch_hican be used to restrict the particles included inthe histogram in coordinate space, but do not modify the histogram axes.
Each particle species produces a separate histogram that is output as
<species name>_<diag name>. No unit conversion or normalization by cell volume is applied.Particles outside the histogram bounds are discarded.
<diag name>.hist_species_names(string)List of species to include. Can be beam and/or plasma species.
<diag name>.hist_num_bins(intor 2int)Number of bins per histogram axis.
<diag name>.hist_bins_lo(flaotor 2flaot)Lower bound of each histogram axis.
<diag name>.hist_bins_hi(flaotor 2flaot)Upper bound of each histogram axis.
<diag name>.hist_function(string)Parser expression defining the first histogram axis as a function of particle properties:
x,y,z,ux,uy,uz,ga_psi,w,ion_lev.Here,
ga_psiis the quasi-static weighting factor for plasma particles,ion_levis the ionization level (for ionizable species), andwis themacro-particle weight.
<diag name>.hist_function2(string) optionalParser expression defining the second histogram axis. Uses the same variables as
<diag name>.hist_function.<diag name>.hist_weight(string) optional (defaultw)Parser expression defining the weight contributed by each particle to the histogram.
For plasma particles, this weight is automatically multiplied by
ga_psito obtain the physical particle weight. Uses the same variables as
<diag name>.hist_function. This can also be used to filter particles.<diag name>.hist_add_z_axis(bool) optional (defaultfalse)Add the zeta axis from the simulation to the histogram output.
This is more efficient than adding z as a custom histogram axis using
hist_functionorhist_function2. If disabled the histogram contains data fromall z slices in the range given by
patch_loandpatch_hi.Example:
constisconst)