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

Preparation for adding electrons #207

Merged
merged 42 commits into from
Apr 29, 2024
Merged

Preparation for adding electrons #207

merged 42 commits into from
Apr 29, 2024

Conversation

johnomotani
Copy link
Collaborator

A lot of minor structural changes, being added now to reduce the number of conflicts when the electron branch (the latest is currently electrons-jto-debug) is added.

johnomotani and others added 30 commits April 26, 2024 14:07
If dimension has size 1 for some input it cannot be parallelised, so
there is no need to check it (for that case). By skipping size 1
dimensions, we can reduce the number of combinations that need debug
tests, which speeds up the tests.
Ensures that a correct region type is being used, rather than relying on
the calling site of the derivative_*!() function to have already set a
correct region type.
Allows `setindex!()` for DebugMPISharedArray to be used with, for
example, `Float128` values, not just `mk_float`. Any type that is OK for
the underlying `setindex!()` of `Array{mk_float,N}` should be supported.
This makes it easier to add the run_id to multiple output files, which
might not be created by the same function.
The separate functions are also called by a single output function so
the original call-site does not get more complicated, but the individual
functions can be called on their own if necessary.
It can be useful to know how much of a change the 'moment constraint
corrections' are having to apply. To help diagnose this, store the
values of the coefficients used to apply the constraints (for each
species of ion and neutral, at each spatial point) into arrays in the
`moments` structs, and write out the most recent values at each output.
…ance!()

Will allow them to be passed into init_pdf_and_moments() in future to be
used in kinetic electron setup.
Will be useful for boundary conditions for electrons.
Allow passing or returning `nothing` if a coordinate is not present.
Define reload_moments(), etc., functions at the module level instead of
locally inside reload_evolving_fields!(). This will allow (some of)
these functions to be used separately to reload electron variables.
Previously, the moments of the source term were introduced in vpa/vz
'advection speed' and in source_terms in terms of
`external_source_amplitude`. The moments were taken assuming that the
source is a Maxwellian with temperature `T_source`. This is not true for
"energy_source" (where the source is defined as roughly 'f_M - f' in
such a way that no particles are introduced). However, the moments of
the source term are already calculated in external_density_source and
external_pressure_source, so these can be used instead to support
more generic source terms.
The corrected form is similar to the ion one, and has correct
dimensions.
@johnomotani johnomotani merged commit c0880a5 into master Apr 29, 2024
17 checks passed
@johnomotani johnomotani deleted the pre-electron-updates branch April 29, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants