mirror_terms Module



Variables

Type Visibility Attributes Name Initial
logical, public :: mirror_initialized = .false.
real, public, dimension(2, 2) :: time_mirror = 0.
integer, private, dimension(:, :), allocatable :: mirror_sign
real, public, dimension(:, :, :, :), allocatable :: mirror
real, private, dimension(:, :, :, :), allocatable :: mirror_rad_var
real, private, dimension(:, :, :), allocatable :: mirror_tri_a
real, private, dimension(:, :, :), allocatable :: mirror_tri_b
real, private, dimension(:, :, :), allocatable :: mirror_tri_c
real, private, dimension(:, :, :), allocatable :: mirror_int_fac
real, private, dimension(:, :, :, :), allocatable :: mirror_interp_loc
integer, private, dimension(:, :, :, :), allocatable :: mirror_interp_idx_shift
complex, private, dimension(:, :, :, :), allocatable :: response_apar_denom

Subroutines

public subroutine init_mirror()

mirror has sign consistent with being on RHS of GKE; it is the factor multiplying dg/dvpa in the mirror term mirror_sign set to +/- 1 depending on the sign of the mirror term. NB: mirror_sign = -1 corresponds to positive advection velocity set up the tridiagonal matrix that must be inverted for the implicit treatment of the mirror operator

Arguments

None

private subroutine init_mirror_semi_lagrange()

Arguments

None

private subroutine init_invert_mirror_operator()

mirror_int_fac = exp(vpa^2 * (mudB/dz)/(mudB/dz + Zedpihnc/dz)) is the integrating factor needed to turn the dg/dvpa part of the GKE advance into an advection equation a, b and c contain the sub-, main- and super-diagonal terms, respectively if running in full-flux-surface mode, solve mirror advance in y-space rather than ky-space due to alpha-dependence of coefficients corresponds to sign of mirror term positive on RHS of equation must treat boundary carefully assumes fully upwinded at outgoing boundary corresponds to sign of mirror term negative on RHS of equation must treat boundary carefully assumes fully upwinded at outgoing boundary time_upwind = 0.0 corresponds to centered in time time_upwind = 1.0 corresponds to fully implicit (upwinded) account for fact that we have expanded d(gnorm)/dvpa, where gnorm = g/exp(-v^s); this gives rise to d(gnormexp(-vpa^2))/dvpa + 2vpagnormexp(-vpa^2) term we solve for gnorm*exp(-vpa^2) and later multiply by exp(vpa^2) to get gnorm multiply by mirror coefficient

Arguments

None

private subroutine init_mirror_response()

Arguments

None

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

Read more…

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

public subroutine add_mirror_radial_variation(g, gout)

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

private subroutine get_dgdvpa_ffs(g, ikxyz)

Arguments

Type IntentOptional Attributes Name
complex, intent(inout), dimension(:, :) :: g
integer, intent(in) :: ikxyz

private subroutine get_dgdvpa_explicit(g)

Arguments

Type IntentOptional Attributes Name
complex, intent(inout), dimension(:, :, kxkyz_lo%llim_proc:) :: g

private subroutine add_mirror_term(g, src)

Arguments

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

private subroutine add_mirror_term_ffs(g, src)

Arguments

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

public subroutine advance_mirror_implicit(collisions_implicit, g, apar)

Arguments

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

private subroutine get_mirror_rhs_g_contribution(g_in, apar, imu, ikxkyz, rhs)

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:) :: g_in
complex, intent(in) :: apar
integer, intent(in) :: imu
integer, intent(in) :: ikxkyz
complex, intent(out), dimension(:) :: rhs

private subroutine get_mirror_rhs_apar_contribution(rhs, apar, imu, ikxkyz)

Arguments

Type IntentOptional Attributes Name
complex, intent(out), dimension(:) :: rhs
complex, intent(in) :: apar
integer, intent(in) :: imu
integer, intent(in) :: ikxkyz

private subroutine vpa_interpolation(grid, interp)

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:, :, kxkyz_lo%llim_proc:) :: grid
complex, intent(out), dimension(:, :, kxkyz_lo%llim_proc:) :: interp

private subroutine invert_mirror_operator(imu, ilo, g)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: imu
integer, intent(in) :: ilo
complex, intent(inout), dimension(:) :: g

public subroutine finish_mirror()

Arguments

None

private subroutine finish_mirror_semi_lagrange()

Arguments

None

private subroutine finish_invert_mirror_operator()

Arguments

None

private subroutine finish_mirror_response()

Arguments

None