get_fields_ffs Subroutine

public subroutine get_fields_ffs(g, phi, apar, implicit_solve)

get_fields_ffs accepts as input the guiding centre distribution function g and calculates/returns the electronstatic potential phi for full_flux_surface simulations

Layouts Parameters Arrays Grids Calculations Geometry

calculate the contribution to quasineutrality coming from the velocity space integration of the guiding centre distribution function g; the sign is consistent with phi appearing on the RHS of the eqn and int g appearing on the LHS. this is returned in source use sum_s int d3v and QN to solve for phi NB: assuming here that ntubes = 1 for FFS sim if using a modified Boltzmann response for the electrons, then phi at this stage is the 'inhomogeneous' part of phi. first must get phi on grid that includes positive and negative ky (but only positive kx) calculate the flux surface average of this phi_inhomogeneous use the flux surface average of phi_inhomogeneous, together with the adiabatic_response_factor, to obtain the flux-surface-averaged phi

use the computed flux surface average of phi as an additional sosurce in quasineutrality to obtain the electrostatic potential; only affects the ky=0 component of QN if adiabatic electrons are not employed, then no explicit equation for the ky=kx=0 component of phi; hack for now is to set it equal to zero.

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) :: g
complex, intent(out), dimension(:, :, -nzgrid:, :) :: phi
complex, intent(out), dimension(:, :, -nzgrid:, :) :: apar
logical, intent(in), optional :: implicit_solve