advance_mirror_explicit Subroutine

public subroutine advance_mirror_explicit(g, gout)

advance_mirror_explicit calculates the contribution to the RHS of the gyrokinetic equation due to the mirror force term; it treats all terms explicitly in time

start the timer for this subroutine

assume we are simulating a single flux surface

swap from ky >= 0 and all kx to kx >= 0 and all ky needed for ky2y transform below for upwinding of vpa, need to evaluate dg/dvpa in y-space this is necessary because the advection speed contains dB/dz, which depends on y first must take g(ky,kx) and transform to g(y,kx) remap g so velocities are local next, calculate dg/dvpa; we enforce a boundary condition on , but with full_flux_surface = T, g = / F, so we use the chain rule to get two terms: one with exp(vpa^2)*d/dvpa and another that is proportional to exp(vpa^2) * /F * d ln F /dvpa remove exp(-vpa^2) normalisation from g before differentiating get d / dvpa then take the results and remap again so y,kx,z local.

finally add the mirror term to the RHS of the GK eqn

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) :: g
complex, intent(inout), dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) :: gout