GK sheath BC: adding a mu dependence to parallel cut velocity#960
Open
Antoinehoff wants to merge 27 commits intomainfrom
Open
GK sheath BC: adding a mu dependence to parallel cut velocity#960Antoinehoff wants to merge 27 commits intomainfrom
Antoinehoff wants to merge 27 commits intomainfrom
Conversation
… made up distribution function and potential. It seems to work well for the lower edge, I think the upper edge is not valid because of a wrong setup of the ghost ranges.
…tices. Also fixed a missing factor of 2.
…hakim/gkeyll into new_gk_bc_sheath_unit_test
…ent behavior on each end
…ath_gk test. Add cases for electrons and ions and positive/negative potential
…ce of vparcut. The kernels are updated accordingly, the sheath test looks ok when alpha=1. The kernels are not tested yet for non unity alpha.
…f where it should be non zero. We also add a shift to the dist func so that we are far from 0 everywhere and a parallel flow to make sure that the dist func is reversed with respect to vpar.
…es not work on GPU yet.
… gk_sheath_vcut_mu_dep
…t by default, i.e. alpha_mu = 1.0
…ject because the vel_map is not using the gk hybrid basis.
…d checking cells that are crossed by the vcut because they may have 0 or non 0 features in an impredictive way.
…he only method is to set up an array outside using the get_basis routine and pass it using the set_alpha_mu routine.
… between the perpendicular conf. directions and mu. We can now evaluate vpar cut everywhere (with the surrogate) and store it before calling the kernels.
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.
In this PR, we implement the ability to apply a conducting sheath boundary condition (BC) with a$\mu$ -dependent parallel velocity cut (see DR #957 for more details). This PR also includes and improves the sheath BC unit test presented in PR #956. The kernels are generated with the branch of this Gkylcas PR
Design choice
The main design decision is to encode the$\mu$ dependence in a non-dimensional factor $\alpha(\mu)$ such that,
where$v_{\parallel \text{cut} 0}$ is the currently implemented cutting parallel velocity. This allows to preserve the existing code structure, leaving the cut velocity evaluation at the kernel level.
Implementation details
The main changes are mainly centered around the sheath BC updater
gkyl_bc_sheath_gyrokinetic. A new DG array is added to the updater structure,to store the$\alpha(\mu)$ factor as a 2D $(v_\parallel,\mu)$ GK hybrid DG array. The use of a 2D representation simplifies the kernel generation by making the nodal evaluation more straightforward.
The updater creator,
gkyl_bc_sheath_gyrokinetic_new, setsalpha_mu = 1by default, which yields the current state of the sheath BC implementation.One can manipulate
alpha_muwith the new functiongkyl_bc_sheath_gyrokinetic_set_alpha_muto copy an existing array intoalpha_mu.Demonstration
We run$\mu$ -dependent parallel cut velocity as
gyrokinetic/unit/ctest_bc_twistshift.cwhich sets up Maxwellian distribution functions in1x2v,2x2v, and3x2vdomains. This test also sets awhich adds an exponential decaying term to the cutting velocity. This function is projected on a DG GK hybrid 2v basis:
where the
grid_velis the same as the one that define thebc_sheathupdater and thebasis_velis obtained using a newbc_sheathinterfaceWe then copy our
alpha_muarray to thebc_sheathupdater usingWe run and plot the resulting distribution functions using this script: bc_sheath_test.sh, which produces figures like:
Note that we varied the Maxwellian parallel flow depending on the dimensionality, specifically$u_\parallel=0$ for $u_\parallel=v_{th}$ for $u_\parallel=-v_{th}$ for
1x2v(bottom row),2x2v(middle row), and3x2v(top row).