Addition of complete electromagnetic momentum fluxes #474
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.
Summary of changes:
The current implementation of the momentum flux in$\delta A_\parallel$ and $\delta B_\parallel$ components. The attached document explains which terms have been neglected, and shows how to write them in a form compatible with the
CGYROis missing some electromagnetic contributions in both theCGYROsource code. Specifically, we show that implementing the previously neglected terms only requires modifying the arrayjxvec_cincgyro/src/cgyro_init_arrays.F90. The changes also do not involve any changes to the memory requirements at run time, only during initialisation.Benchmark results:
These changes have been benchmarked against an equivalent set of momentum-flux diagnostics that were concurrently implemented in$\theta_0$ ($\beta_e$ . The relevant input files for both codes are attached (input_files.zip). Convergence checks in both the spatial and velocity resolution were performed.
GENE. We consider a single linear mode at non-zeroPX0) and at finiteIn the first figure below, we plot the growthrate and frequency of the mode as a function of time, showing good agreement between the codes ($\delta \phi$ ) and electromagnetic (sum of $\delta A_\parallel$ and $\delta B_\parallel$ ) components of the fluxes, respectively. The reason that we do not show the $\delta A_\parallel$ and $\delta B_\parallel$ components separately in this case is because
GENEin blue andCGYROin red). The eigenfunctions (second figure) show similarly good agreement. In the third figure, we plot the "quasilinear" particle and heat fluxes as a function of time; these are, up to normalisations, defined in the same way as those output directly from a linearCGYROsimulation. In this figure, the solid and dash-dot lines are the electrostatic (GENEdoes not separate them for the particle and heat fluxes. Finally, the result of the benchmark is shown in the fourth figure, where we plot the contributions to the momentum flux for each field. There is excellent agreement across all channels, where all errors are smaller than the relative (and indeed absolute) errors in the particle and heat fluxes.Effect of changes:
To demonstrate why these changes are necessary within$\delta \phi$ , $\delta A_\parallel$ , $\delta B_\parallel$ ). The green lines correspond to a run before the changes, while the red lines correspond to a run after.
CGYRO, we run the same linear simulation on commits740bb2dc811bc1ad38be65ea4b87330995931305(before the changes) andeb589caf0ced4ead2ccda5f1714eb1561fb7e543(after the changes). The results of this are shown in the final figure below, where the columns are the contributions from each species (electron, ion, total), while the rows are the contributions from each field (As expected, the$\delta \phi$ component of the momentum flux is unchanged, and is dominated by the ion contribution. However, the $\delta A_\parallel$ component is changed quite substantially for the electrons, reversing in sign and almost doubling in magnitude. This is due to the fact that the diagnostics were missing the contribution from the Maxwell stress, which can be significant for the electrons as they carry most of the current. The overall effect of this is an almost doubling of the total momentum flux in the $\delta A_\parallel$ channel. Finally, the $\delta B_\parallel$ channel sees a significant reduction in overall momentum flux, coming from the suppression of the electrons. This is because without the added terms in this channel, the $\delta B_\parallel$ momentum flux is overestimated by a factor of $(k_\perp \rho_s)^{-2}$ , which is significant for electrons at the wavenumber considered ($k_y \rho_D = 0.3$ ). An explanation for this is provided in the attached document.
Overall, these changes mean that the momentum flux calculated in
CGYROis now a complete description of the turbulent momentum flux generated by the fluctuations, capturing the physics associated with the Maxwell stress and the transport of momentum along perturbed field lines that was previously absent.Figures
Growth rate and frequency:

Eigenfunctions:

Particle and heat fluxes:

Momentum flux:

Momentum flux comparison:
