ORB5  v4.9.4
sources Module Reference

Data Types

type  pointer_intnc
 
type  pointer_ncmatrix
 

Functions/Subroutines

subroutine, public init_sources
 Initialize the sources module. More...
 
subroutine, public add_sources (step)
 Add various source terms to the RHS of Vlasov/Boltzmann equation. More...
 
subroutine source_diagnostics (isp, spos, weightperb, ut, utob, av_ut, en, ithread, type)
 Diagnostic for the source terms. More...
 
subroutine heating_init
 Initialize heating source. More...
 
subroutine heating_disp (isp)
 Call the heating routines. More...
 
subroutine fixed_heating_basic (isp)
 Heat the plasma using a fixed heat source with a defined radial profile and amplitude. More...
 
subroutine fixed_heating_ecrh (pic1_loc, pic2_loc, isp)
 Heat the electrons using the ECRH heating scheme. More...
 
subroutine edge_buffer_krook_conserving (pic1_loc, pic2_loc, npart_loc, isp)
 Add a Krook buffer at the outer radial edge to damp df. This Krook conserve density. More...
 
subroutine edge_buffer_krook_non_conserving (pic1_loc, pic2_loc, npart_loc, isp)
 Add a naive Krook buffer at the outer radial edge to damp df. More...
 
subroutine edge_buffer_collisional (pic1_loc, pic2_loc, isp)
 Add a collisional buffer at the outer radial edge to damp df. More...
 
real function get_radial_profile (species, s)
 Get source radial profile at particle's position by interpolation. More...
 
subroutine heating (isp)
 Heating term: damp \delta f(\eps,\psi)->0 in order to control departure of temperature profile from initial state With nl_wdecay_gyro_switch=.true. designed to simulate GYRO heating source. More...
 
subroutine bin_en_radius (en, sigmak, isp, bin_en, bin_r)
 Compute the bin index of a particle. More...
 
subroutine noise_control_init
 Initialize the noise control. More...
 
subroutine noise_control (isp, act)
 Add a decay term to the weights, while conserving various moments in spatial bins. Also 'splits' weight by collecting adiabatic distributions in bins. More...
 
subroutine source_cons (moments, ut, ut_over_b, ut_over_b_ba, en, isp)
 Returns the moment M_i to be conserved. More...
 
subroutine force_flow (pic1_loc, pic2_loc, npart_loc, isp)
 
subroutine coarsen (isp)
 Routine to apply coarse graining. More...
 

Variables

integer, dimension(:,:,:), allocatable, save nbin
 
integer, save nbins_nc
 
type(pointer_ncmatrix), dimension(:), allocatable, save ncmat
 
type(pointer_ncmatrix), dimension(:), allocatable, save fhsmat
 
type(pointer_intnc), dimension(:), allocatable, save ncint
 
type(pointer_intnc), dimension(:), allocatable, save fhsint
 
integer, save nbins_r
 
integer, save nbins_en
 
real, dimension(:,:,:,:), allocatable, save wtot
 
real, dimension(:,:,:,:), allocatable, save wtot2
 
real, dimension(:,:,:,:), allocatable, save ntot
 
real, dimension(:,:,:,:), allocatable, save ftot
 
real, dimension(:,:,:,:), allocatable, save v2ft
 
real, dimension(:,:,:), allocatable, save source_part
 
real, dimension(:,:,:), allocatable, save source_heat
 
real, dimension(:,:,:), allocatable, save f0_bins
 
real, dimension(:,:,:), allocatable, save v2ft2
 
real, dimension(:), allocatable, save wtot_all_ff
 
real, dimension(:), allocatable, save wtot_all_f0
 
real, dimension(:,:), allocatable, save en_max
 
real, dimension(:,:), allocatable, save radial_profile
 
real, dimension(:), allocatable, save rpar
 
integer, parameter momentcons =3
 
integer, parameter maxmoments =4
 
integer, dimension(:,:), allocatable, save wd_cons
 
integer, dimension(:), allocatable, save nmoments
 

Function/Subroutine Documentation

◆ add_sources()

subroutine, public sources::add_sources ( integer, intent(in)  step)

Add various source terms to the RHS of Vlasov/Boltzmann equation.

Adds heating, Krook, coarse graining and force flow terms

Parameters
[in]stepCurrent step number
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bin_en_radius()

subroutine sources::bin_en_radius ( real, intent(in)  en,
real, intent(in)  sigmak,
integer, intent(in)  isp,
integer, intent(out)  bin_en,
integer, intent(out)  bin_r 
)

Compute the bin index of a particle.

Note
OpenACC version requires this routine to be out of heating "contains" section
Parameters
[in]enParticle's kinetic energy
[in]sigmakRadial position
[in]ispCurrent species
[out]bin_enBins in energy space
[out]bin_rBins in the redial direction
+ Here is the caller graph for this function:

◆ coarsen()

subroutine sources::coarsen ( integer, intent(in)  isp)
private

Routine to apply coarse graining.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ edge_buffer_collisional()

subroutine sources::edge_buffer_collisional ( real, dimension(:,:), intent(inout)  pic1_loc,
real, dimension(:,:), intent(inout)  pic2_loc,
integer, intent(in)  isp 
)

Add a collisional buffer at the outer radial edge to damp df.

Parameters
[in,out]pic1_locpic array of a certain species.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ edge_buffer_krook_conserving()

subroutine sources::edge_buffer_krook_conserving ( real, dimension(:,:), intent(inout)  pic1_loc,
real, dimension(:,:), intent(inout)  pic2_loc,
integer, intent(in)  npart_loc,
integer, intent(in)  isp 
)
private

Add a Krook buffer at the outer radial edge to damp df. This Krook conserve density.

Parameters
[in]npart_locLocal number of particles
[in,out]pic1_locArray containing the non-static properties of the markers
[in,out]pic2_locArray containing the static propoerties of the markers
[in]ispSpecies under consideration
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ edge_buffer_krook_non_conserving()

subroutine sources::edge_buffer_krook_non_conserving ( real, dimension(:,:), intent(inout)  pic1_loc,
real, dimension(:,:), intent(inout)  pic2_loc,
integer, intent(in)  npart_loc,
integer, intent(in)  isp 
)

Add a naive Krook buffer at the outer radial edge to damp df.

Parameters
[in]npart_locLocal number of particles
[in,out]pic1_locArray containing the non-static properties of the markers
[in,out]pic2_locArray containing the static propoerties of the markers
[in]ispSpecies under consideration
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fixed_heating_basic()

subroutine sources::fixed_heating_basic ( integer, intent(in)  isp)
private

Heat the plasma using a fixed heat source with a defined radial profile and amplitude.

The heat source is furthermore modified in a similar way as the Krook operator to ensure that the density, parallel momentum and zonal structure are conserved.

Parameters
[in]ispOn which species to act on
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fixed_heating_ecrh()

subroutine sources::fixed_heating_ecrh ( real, dimension(:,:), intent(inout)  pic1_loc,
real, dimension(:,:), intent(inout)  pic2_loc,
integer, intent(in)  isp 
)
private

Heat the electrons using the ECRH heating scheme.

Parameters
[in,out]pic1_locpic array of a certain species.
[in,out]pic2_locpic array of a certain species.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ force_flow()

subroutine sources::force_flow ( real, dimension(:,:), intent(inout)  pic1_loc,
real, dimension(:,:), intent(inout)  pic2_loc,
integer, intent(in)  npart_loc,
integer, intent(in)  isp 
)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_radial_profile()

real function sources::get_radial_profile ( integer, intent(in)  species,
real, intent(in)  s 
)

Get source radial profile at particle's position by interpolation.

Note
OpenACC version requires this routine to be out of fixed_heating_basic "contains" section
Parameters
[in]speciesCurrent species
[in]sRadial position of the particle
Returns
Value of the radial profile
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ heating()

subroutine sources::heating ( integer, intent(in)  isp)
private

Heating term: damp \delta f(\eps,\psi)->0 in order to control departure of temperature profile from initial state With nl_wdecay_gyro_switch=.true. designed to simulate GYRO heating source.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ heating_disp()

subroutine sources::heating_disp ( integer, intent(in)  isp)

Call the heating routines.

Parameters
[in]ispCurrent species (assumed to be kinetic)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ heating_init()

subroutine sources::heating_init
private

Initialize heating source.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_sources()

subroutine, public sources::init_sources

Initialize the sources module.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ noise_control()

subroutine sources::noise_control ( integer, intent(in)  isp,
logical, intent(in)  act 
)

Add a decay term to the weights, while conserving various moments in spatial bins. Also 'splits' weight by collecting adiabatic distributions in bins.

Parameters
[in]ispOn which species to act on
[in]actWhether to act on weights (otherwise just collect adiabatic distribution)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ noise_control_init()

subroutine sources::noise_control_init
private

Initialize the noise control.

Todo:
Define binings and allocate necessary arrays. Bining for vpll_avg. Should be input parameters really.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ source_cons()

subroutine sources::source_cons ( real, dimension(:), intent(out)  moments,
real, intent(in)  ut,
real, intent(in)  ut_over_b,
real, intent(in)  ut_over_b_ba,
real, intent(in)  en,
integer, intent(in)  isp 
)
private

Returns the moment M_i to be conserved.

Note
OpenACC version requires this routine to be out of noise_control "contains" section
Parameters
[in]utparallel velocity, v_par
[in]ut_over_bv_par/b
[in]ut_over_b_bav_par/b bounce averaged
[in]enKinetic energy
[in]ispSpecies under consideration
[out]momentsArray containing the moments to be conserved
+ Here is the caller graph for this function:

◆ source_diagnostics()

subroutine sources::source_diagnostics ( integer, intent(in)  isp,
real, intent(in)  spos,
real, intent(in)  weightperb,
real, intent(in)  ut,
real, intent(in)  utob,
real, intent(in)  av_ut,
real, intent(in)  en,
integer, intent(in)  ithread,
integer, intent(in)  type 
)
private

Diagnostic for the source terms.

This diagnostic computes the radial profile of the density, energy, and ZF injected by the source terms on a s grid defined by nc_bin_s.

Parameters
[in]ispCurrent species
[in]sposParticle's radial s position
[in]weightperbContribution of the NC/heating to the weight
[in]utParallel velocity
[in]utobParallel velocity over B
[in]av_utMean parallel velocity
[in]enKinetic energy
[in]ithreadOpenMP thread
[in]typeType of diagnostic (NSEL_NC for noise control of NSEL_HEATING for heating)
+ Here is the caller graph for this function:

Variable Documentation

◆ en_max

real, dimension(:,:), allocatable, save sources::en_max
private

◆ f0_bins

real, dimension(:,:,:), allocatable, save sources::f0_bins
private

◆ fhsint

type(pointer_intnc), dimension(:), allocatable, save sources::fhsint
private

◆ fhsmat

type(pointer_ncmatrix), dimension(:), allocatable, save sources::fhsmat
private

◆ ftot

real, dimension(:,:,:,:), allocatable, save sources::ftot
private

◆ maxmoments

integer, parameter sources::maxmoments =4
private

◆ momentcons

integer, parameter sources::momentcons =3
private

◆ nbin

integer, dimension(:,:,:), allocatable, save sources::nbin
private

◆ nbins_en

integer, save sources::nbins_en
private

◆ nbins_nc

integer, save sources::nbins_nc
private

◆ nbins_r

integer, save sources::nbins_r
private

◆ ncint

type(pointer_intnc), dimension(:), allocatable, save sources::ncint
private

◆ ncmat

type(pointer_ncmatrix), dimension(:), allocatable, save sources::ncmat
private

◆ nmoments

integer, dimension(:), allocatable, save sources::nmoments
private

◆ ntot

real, dimension(:,:,:,:), allocatable, save sources::ntot
private

◆ radial_profile

real, dimension(:,:), allocatable, save sources::radial_profile
private

◆ rpar

real, dimension(:), allocatable, save sources::rpar
private

◆ source_heat

real, dimension(:,:,:), allocatable, save sources::source_heat
private

◆ source_part

real, dimension(:,:,:), allocatable, save sources::source_part
private

◆ v2ft

real, dimension(:,:,:,:), allocatable, save sources::v2ft
private

◆ v2ft2

real, dimension(:,:,:), allocatable, save sources::v2ft2
private

◆ wd_cons

integer, dimension(:,:), allocatable, save sources::wd_cons
private

◆ wtot

real, dimension(:,:,:,:), allocatable, save sources::wtot
private

◆ wtot2

real, dimension(:,:,:,:), allocatable, save sources::wtot2
private

◆ wtot_all_f0

real, dimension(:), allocatable, save sources::wtot_all_f0
private

◆ wtot_all_ff

real, dimension(:), allocatable, save sources::wtot_all_ff
private