fields_fluxtube Module

Module for advancing and initialising the fields for a fluxtube simulation

Advance fields for fluxtube routines Initialise Routine



Variables

Type Visibility Attributes Name Initial
integer, private :: zm

Interfaces

public interface get_fields_fluxtube

  • private subroutine get_fields_fluxtube_vmlo(g, phi, apar, bpar, dist, skip_fsa)

    If we are parallelising over (vpa,mu) then this subroutine is called This is the more common version used compared with parallelising over (kx,ky,z) and is the default for stella. Here we calculate: sum_s int dv (J0 * g) and then call get_phi which divides this by the appropriate gamtot factor TODO-GA: remove apar from this and make it only needed for EM stella

    Layouts Arrays Parameters Grids Calculations Routines from other field modules Note that this advances phi for the electrostatic, fluxtube case. If electromagnetic effects are included then phi will be advanced below First gyroaverage the distribution function g at each phase space location and store this as g_scratch = = J_0 g in k-space If we are allowing for Radial Variation then we must modify . This is done in the fields_radialvariation module, but is not needed for standard stella (as these are false by default). Next, integrate over velocity space and sum over species and store the result in phi, which will be further modified below to account for polarization term Get phi routine inverts the appropriate 'Gamma_0' factor that multiplies the terms onto the RHS of the equation. The exact form of this factor depends on the simulation e.g. we may have adiabatic electrons, kinetic electrons etc. and also if Radial Varation effects are included (these are false by default) This is the inversion routine for electrostatic, fluxtube stella If we are allowing for radial variation this factor changes further If we have electromagnetic effects we need to add the terms due to A_parallel and B_parallel and also need to advance phi including electromagnetic effects

    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
    complex, intent(out), dimension(:, :, -nzgrid:, :) :: bpar
    character(len=*), intent(in) :: dist
    logical, intent(in), optional :: skip_fsa
  • private subroutine get_fields_fluxtube_kxkyzlo(g, phi, apar, bpar, dist, skip_fsa)

    If we are parallelising over (kx,ky,z) then this subroutine is called This is the less common version used compared with parallelising over (vpa, mu). This is NOT the default routine for stella, and the flag must be set to use this routine. Here we calculate: sum_s int dv (J0 * g) and then call get_phi which divides this by the appropriate gamtot factor TODO-GA: remove apar from this and make it only needed for EM stella

    Layouts Arrays Parameters Grids Calculations Routines from other field modules Note that this advances phi for the electrostatic, fluxtube case. If electromagnetic effects are included then phi will be advanced below First gyroaverage the distribution function g at each phase space location and store this as g0 = = J_0 g in k-space Next, integrate over velocity space and sum over species and store the result in phi, which will be further modified below to account for polarization term If we are allowing for radial variation this factor changes further If we have electromagnetic effects we need to add the terms due to A_parallel and B_parallel and also need to advance phi including electromagnetic effects

    Arguments

    Type IntentOptional Attributes Name
    complex, intent(in), dimension(:, :, kxkyz_lo%llim_proc:) :: g
    complex, intent(inout), dimension(:, :, -nzgrid:, :) :: phi
    complex, intent(inout), dimension(:, :, -nzgrid:, :) :: apar
    complex, intent(inout), dimension(:, :, -nzgrid:, :) :: bpar
    character(len=*), intent(in) :: dist
    logical, intent(in), optional :: skip_fsa

Subroutines

public subroutine advance_fields_fluxtube(g, phi, apar, bpar, dist, skip_fsa)

This calls the appropriate routines needed to advance phi in the main code when using fluxtube stella, depending on the distribution (i.e. if the information is parallelised over (kx,ky,z) or (vpa,mu) ). Note that Apar and Bpar are only advanced when using EM so these are in fields_electromagnetic.fpp

Read more…

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) :: g
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: phi
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: apar
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: bpar
character(len=*), intent(in) :: dist
logical, intent(in), optional :: skip_fsa

private subroutine get_fields_fluxtube_vmlo(g, phi, apar, bpar, dist, skip_fsa)

If we are parallelising over (vpa,mu) then this subroutine is called This is the more common version used compared with parallelising over (kx,ky,z) and is the default for stella. Here we calculate: sum_s int dv (J0 * g) and then call get_phi which divides this by the appropriate gamtot factor TODO-GA: remove apar from this and make it only needed for EM stella

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
complex, intent(out), dimension(:, :, -nzgrid:, :) :: bpar
character(len=*), intent(in) :: dist
logical, intent(in), optional :: skip_fsa

private subroutine get_fields_fluxtube_kxkyzlo(g, phi, apar, bpar, dist, skip_fsa)

If we are parallelising over (kx,ky,z) then this subroutine is called This is the less common version used compared with parallelising over (vpa, mu). This is NOT the default routine for stella, and the flag must be set to use this routine. Here we calculate: sum_s int dv (J0 * g) and then call get_phi which divides this by the appropriate gamtot factor TODO-GA: remove apar from this and make it only needed for EM stella

Read more…

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:, :, kxkyz_lo%llim_proc:) :: g
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: phi
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: apar
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: bpar
character(len=*), intent(in) :: dist
logical, intent(in), optional :: skip_fsa

private subroutine get_phi(phi, dist, skip_fsa)

The 'phi' variable passed in is: sum_s int dv (J0 * g) This routine divides by the appropriate gamtot factor depending on if we have kinetic or adiabatic electrons, and also on whether we are using 'g' or 'h' as our distribution function that we are evolving. Note that this routine is only called in the Electrostatic, Fluxtube case.

Read more…

Arguments

Type IntentOptional Attributes Name
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: phi
character(len=*), intent(in) :: dist
logical, intent(in), optional :: skip_fsa

public subroutine init_fields_fluxtube()

Initialise arrays that are needed during the main time advance loop in the field solve for the flux tube simulations only These are initialised once and then used throughout the rest of the simulation gamtot = 1 - gamma0 = Z^2*n/T * int e^(-v^2) * (1 - J0^2) dv If using adiabatic electrons then this factor is modified and we use gamtot3 which includes the Boltmann response

Read more…

Arguments

None