fields_ffs Module

Module for advancing and initialising the fields when Full Flux Surface effects are included



Variables

Type Visibility Attributes Name Initial
type(coupled_alpha_type), private, dimension(:, :, :), allocatable :: gam0_ffs

arrays allocated/used if simulating a full flux surface

type(gam0_ffs_type), private, dimension(:, :), allocatable :: lu_gam0_ffs
complex, private, dimension(:), allocatable :: adiabatic_response_factor
logical, private :: fields_initialised = .false.

Subroutines

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

Read more…

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

private subroutine get_phi_ffs(rhs, phi)

change from rhs defined on grid with ky >=0 and kx from 0,...,kxmax,-kxmax,...,-dkx to rhs_swap defined on grid with ky = -kymax,...,kymax and kx >= 0 solve sum_s Z_s int d^3v = gam0*phi where sum_s Z_s int d^3v is initially passed in as rhs_swap and then rhs_swap is over-written with the solution to the linear system

Read more…

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:, :, -nzgrid:) :: rhs
complex, intent(out), dimension(:, :, -nzgrid:) :: phi

public subroutine get_fields_source(gold, phiold, source)

Layouts Parameters Arrays Grids Calculations

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) :: gold
complex, intent(in), dimension(:, :, -nzgrid:, :) :: phiold
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: source

private subroutine get_g_integral_contribution_source(g, source)

Layouts Parameters Grids Calculations assume there is only a single flux surface being simulated integrate over velocity space and sum over species within each processor as v-space and species possibly spread over processors, wlil need to gather sums from each proceessor and sum them all together below gather sub-sums from each processor and add them together store result in phi, which will be further modified below to account for polarization term no longer need , so deallocate

Arguments

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

public subroutine init_fields_ffs()

Grids

Read more…

Arguments

None

private subroutine init_gamma0_factor_ffs()

calculate and LU factorise the matrix multiplying the electrostatic potential in quasineutrality this involves the factor 1-Gamma_0(kperp(alpha))

Read more…

Arguments

None

private subroutine init_adiabatic_response_factor()

solves Delta * phi_hom = -delta_{ky,0} * ne/Te for phi_hom this is the vector describing the response of phi_hom to a unit impulse in phi_fsa it is the sum over ky and integral over kx of this that is needed, and this is stored in adiabatic_response_factor

Read more…

Arguments

None

public subroutine finish_fields_ffs()

arrays only allocated/used if simulating a full flux surface

Arguments

None