ORB5  4.00
Loading...
Searching...
No Matches
sources.F90 File Reference

Data Types

type  sources::pointer_ncmatrix
type  sources::pointer_intnc

Modules

module  sources

Functions/Subroutines

subroutine, public sources::init_sources
 Initialize the sources module.
subroutine, public sources::add_sources (step)
 Add various source terms to the RHS of Vlasov/Boltzmann equation.
subroutine sources::source_diagnostics (isp, spos, weightperb, ut, utob, av_ut, en, ithread, type)
 Diagnostic for the source terms.
subroutine sources::heating_init
 Initialize heating source.
subroutine read_profile_from_file (filename, profile)
 Read radial profile of the heat source from a file.
subroutine sources::heating_disp (isp)
 Call the heating routines.
subroutine sources::fixed_heating_basic (isp)
 Heat the plasma using a fixed heat source with a defined radial profile and amplitude.
subroutine fhs_build_mat (pic1_loc, pic2_loc, npart_loc, isp)
subroutine fhs_solve_sys (isp)
 Solve heating conservation system.
subroutine fhs_apply (pic1_loc, pic2_loc, npart_loc, isp)
subroutine sources::fixed_heating_ecrh (pic1_loc, pic2_loc, isp)
 Heat the electrons using the ECRH heating scheme.
subroutine stix_quantites (isp, st, chit, omega_p, omega_ce, omega_b, p_loc, s_loc, t_loc)
subroutine dispersion_relation (isp, theta, p_loc, s_loc, t_loc, n_loc)
subroutine compute_integral (isp, omega_b, p_loc, s_loc, t_loc, theta0, int_ref)
subroutine compute_thetares (isp, omega_ce, omega_b, p_loc, lambda, theta_res)
subroutine compute_group_velocity (isp, n_theta0, omega_p, omega_ce, omega_b, theta, group_velocity)
subroutine compute_theta0 (isp, st, chit, theta0_loc)
subroutine compute_dn (isp, st, chit, rt, zt, vpar, vperp, omega_p, omega_ce, omega_b, p_loc, s_loc, t_loc, tau_abs, nbin_tau, dn, s_par, s_perp)
subroutine compute_gamma (isp, st, chit, rt, zt, vpar, vperp, omega_p, omega_ce, omega_b, p_loc, s_loc, t_loc, tau_abs, nbin_tau, dn, s_par, s_perp, gamma_par, gamma_perp)
subroutine compute_tau_abs (isp, nbin_tau, tau_abs)
subroutine compute_albajar_derivatives (m, xn, yn, a_c, a_x, a_y, a_xy, a_yy)
subroutine compute_jm (m, xn, yn, j_m)
subroutine compute_gm (m, x_loc, gm, d_gm, dd_gm)
subroutine compute_km (m, x_loc, km, d_km, dd_km)
subroutine sources::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.
subroutine sources::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.
subroutine sources::edge_buffer_collisional (pic1_loc, pic2_loc, isp)
 Add a collisional buffer at the outer radial edge to damp df.
real(kind=r8) function sources::get_radial_profile (species, s)
 Get source radial profile at particle's position by interpolation.
subroutine sources::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.
subroutine build_heating (pic1_loc, pic2_loc, npart_loc, isp)
 Build heat source.
subroutine fourier_filter (wtot)
subroutine radialcomps (r_bin, q)
subroutine apply_heating (pic1_loc, pic2_loc, npart_loc, isp)
 Apply heating source.
subroutine sources::bin_en_radius (en, sigmak, isp, bin_en, bin_r)
 Compute the bin index of a particle.
subroutine sources::noise_control_init
 Initialize the noise control.
subroutine sources::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.
subroutine build_source_mat (pic1_loc, pic2_loc, npart_loc, isp)
 Builds the source matrix.
subroutine solve_source_sys (isp)
 Solves the source system.
subroutine apply_sources (pic1_loc, pic2_loc, npart_loc, isp)
 Apply the noise control to the Vlasov equation.
subroutine sources::source_cons (moments, ut, ut_over_b, ut_over_b_ba, en, isp)
 Returns the moment M_i to be conserved.
subroutine sources::force_flow (pic1_loc, pic2_loc, npart_loc, isp)
subroutine sources::coarsen (isp)
 Routine to apply coarse graining.
subroutine smooth (pic1_loc, pic2_loc, npart_loc, isp)
integer function bin_cg (phi, chi, uval, mub, tloc, valid)

Variables

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

Function/Subroutine Documentation

◆ apply_heating()

subroutine heating::apply_heating ( real(kind=r8), dimension(:,:), intent(inout) pic1_loc,
real(kind=r8), dimension(:,:), intent(inout) pic2_loc,
integer, intent(in) npart_loc,
integer, intent(in) isp )
private

Apply heating source.

Parameters
[in]npart_locLocal number of particles
[in,out]pic1_locMarkers from pic1 array
[in,out]pic2_locMarkers from pic2 array
[in]ispCurrent species
Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_sources()

subroutine noise_control::apply_sources ( real(kind=r8), dimension(:,:), intent(inout) pic1_loc,
real(kind=r8), dimension(:,:), intent(inout) pic2_loc,
integer, intent(in) npart_loc,
integer, intent(in) isp )
private

Apply the noise control to the Vlasov equation.

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

◆ bin_cg()

integer function coarsen::bin_cg ( real(kind=r8), intent(in) phi,
real(kind=r8), intent(in) chi,
real(kind=r8), intent(in) uval,
real(kind=r8), intent(in) mub,
real(kind=r8), intent(in) tloc,
logical, intent(out) valid )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_heating()

subroutine heating::build_heating ( real(kind=r8), dimension(:,:), intent(inout) pic1_loc,
real(kind=r8), dimension(:,:), intent(inout) pic2_loc,
integer, intent(in) npart_loc,
integer, intent(in) isp )
private

Build heat source.

Parameters
[in,out]pic1_locMarkers from pic1 array
[in,out]pic2_locMarkers from pic2 array
[in]npart_locLocal number of particles
[in]ispCurrent species
Note
This source term won't be added if wdecay_heatrate is 0.0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_source_mat()

subroutine noise_control::build_source_mat ( real(kind=r8), dimension(:,:), intent(inout) pic1_loc,
real(kind=r8), dimension(:,:), intent(inout) pic2_loc,
integer, intent(in) npart_loc,
integer, intent(in) isp )

Builds the source matrix.

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:

◆ compute_albajar_derivatives()

subroutine fixed_heating_ecrh::compute_albajar_derivatives ( integer, intent(in) m,
real(kind=r8), intent(in) xn,
real(kind=r8), intent(in) yn,
real(kind=r8), intent(out) a_c,
real(kind=r8), intent(out) a_x,
real(kind=r8), intent(out) a_y,
real(kind=r8), intent(out) a_xy,
real(kind=r8), intent(out) a_yy )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_dn()

subroutine fixed_heating_ecrh::compute_dn ( integer, intent(in) isp,
real(kind=r8), intent(in) st,
real(kind=r8), intent(in) chit,
real(kind=r8), intent(in) rt,
real(kind=r8), intent(in) zt,
real(kind=r8), intent(in) vpar,
real(kind=r8), intent(in) vperp,
real(kind=r8), intent(in) omega_p,
real(kind=r8), intent(in) omega_ce,
real(kind=r8), intent(in) omega_b,
real(kind=r8), intent(in) p_loc,
real(kind=r8), intent(in) s_loc,
real(kind=r8), intent(in) t_loc,
real(kind=r8), dimension(:), intent(in) tau_abs,
integer, intent(in) nbin_tau,
real(kind=r8), intent(out) dn,
real(kind=r8), intent(out) s_par,
real(kind=r8), intent(out) s_perp )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_gamma()

subroutine fixed_heating_ecrh::compute_gamma ( integer, intent(in) isp,
real(kind=r8), intent(in) st,
real(kind=r8), intent(in) chit,
real(kind=r8), intent(in) rt,
real(kind=r8), intent(in) zt,
real(kind=r8), intent(in) vpar,
real(kind=r8), intent(in) vperp,
real(kind=r8), intent(in) omega_p,
real(kind=r8), intent(in) omega_ce,
real(kind=r8), intent(in) omega_b,
real(kind=r8), intent(in) p_loc,
real(kind=r8), intent(in) s_loc,
real(kind=r8), intent(in) t_loc,
real(kind=r8), dimension(:), intent(in) tau_abs,
integer, intent(in) nbin_tau,
real(kind=r8), intent(in) dn,
real(kind=r8), intent(in) s_par,
real(kind=r8), intent(in) s_perp,
real(kind=r8), intent(out) gamma_par,
real(kind=r8), intent(out) gamma_perp )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_gm()

subroutine fixed_heating_ecrh::compute_gm ( integer, intent(in) m,
real(kind=r8), intent(in) x_loc,
real(kind=r8), intent(out) gm,
real(kind=r8), intent(out) d_gm,
real(kind=r8), intent(out) dd_gm )
private
Here is the caller graph for this function:

◆ compute_group_velocity()

subroutine fixed_heating_ecrh::compute_group_velocity ( integer, intent(in) isp,
real(kind=r8), intent(in) n_theta0,
real(kind=r8), intent(in) omega_p,
real(kind=r8), intent(in) omega_ce,
real(kind=r8), intent(in) omega_b,
real(kind=r8), intent(in) theta,
real(kind=r8), intent(out) group_velocity )
private
Here is the caller graph for this function:

◆ compute_integral()

subroutine fixed_heating_ecrh::compute_integral ( integer, intent(in) isp,
real(kind=r8), intent(in) omega_b,
real(kind=r8), intent(in) p_loc,
real(kind=r8), intent(in) s_loc,
real(kind=r8), intent(in) t_loc,
real(kind=r8), intent(in) theta0,
real(kind=r8), intent(out) int_ref )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_jm()

subroutine fixed_heating_ecrh::compute_jm ( integer, intent(in) m,
real(kind=r8), intent(in) xn,
real(kind=r8), intent(in) yn,
complex(kind=r8), intent(out) j_m )
private
Here is the caller graph for this function:

◆ compute_km()

subroutine fixed_heating_ecrh::compute_km ( integer, intent(in) m,
real(kind=r8), intent(in) x_loc,
real(kind=r8), intent(out) km,
real(kind=r8), intent(out) d_km,
real(kind=r8), intent(out) dd_km )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_tau_abs()

subroutine fixed_heating_ecrh::compute_tau_abs ( integer, intent(in) isp,
integer, intent(in) nbin_tau,
real(kind=r8), dimension(:), intent(inout) tau_abs )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_theta0()

subroutine fixed_heating_ecrh::compute_theta0 ( integer, intent(in) isp,
real(kind=r8), intent(in) st,
real(kind=r8), intent(in) chit,
real(kind=r8), intent(out) theta0_loc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_thetares()

subroutine fixed_heating_ecrh::compute_thetares ( integer, intent(in) isp,
real(kind=r8), intent(in) omega_ce,
real(kind=r8), intent(in) omega_b,
real(kind=r8), intent(in) p_loc,
real(kind=r8), intent(in) lambda,
real(kind=r8), intent(out) theta_res )
private
Here is the caller graph for this function:

◆ dispersion_relation()

subroutine fixed_heating_ecrh::dispersion_relation ( integer, intent(in) isp,
real(kind=r8), intent(in) theta,
real(kind=r8), intent(in) p_loc,
real(kind=r8), intent(in) s_loc,
real(kind=r8), intent(in) t_loc,
real(kind=r8), intent(out) n_loc )
private
Here is the caller graph for this function:

◆ fhs_apply()

subroutine fixed_heating_basic::fhs_apply ( real(kind=r8), dimension(:,:), intent(inout) pic1_loc,
real(kind=r8), 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:

◆ fhs_build_mat()

subroutine fixed_heating_basic::fhs_build_mat ( real(kind=r8), dimension(:,:), intent(inout) pic1_loc,
real(kind=r8), dimension(:,:), intent(inout) pic2_loc,
integer, intent(in) npart_loc,
integer, intent(in) isp )
private
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
Bug
No support for OpenMP for the moment
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fhs_solve_sys()

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

Solve heating conservation system.

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

◆ fourier_filter()

subroutine heating::fourier_filter ( real(kind=r8), dimension(:,:), intent(inout) wtot)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ radialcomps()

subroutine heating::radialcomps ( integer, intent(in) r_bin,
real(kind=r8), dimension(:), intent(inout) q )
private
Parameters
[in]r_binRadial bin index
[in,out]qTrigonometric factors
Here is the caller graph for this function:

◆ read_profile_from_file()

subroutine heating_init::read_profile_from_file ( character(len=*), intent(in) filename,
real(kind=r8), dimension(:), intent(out) profile )

Read radial profile of the heat source from a file.

This subroutine is made to read .dat files produced by the script ./matlab/lanti/python/heat_source.py It assumes that the actual profile begins at the sixth line.

Author
Emmanuel Lanti
Parameters
[in]filenameName of the file containing the radial profile
[out]profileRadial profile read from file
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smooth()

subroutine coarsen::smooth ( real(kind=r8), dimension(:,:), intent(inout) pic1_loc,
real(kind=r8), dimension(:,:), intent(inout) pic2_loc,
integer, intent(in) npart_loc,
integer, intent(in) isp )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ solve_source_sys()

subroutine noise_control::solve_source_sys ( integer, intent(in) isp)
private

Solves the source system.

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

◆ stix_quantites()

subroutine fixed_heating_ecrh::stix_quantites ( integer, intent(in) isp,
real(kind=r8), intent(in) st,
real(kind=r8), intent(in) chit,
real(kind=r8), intent(out) omega_p,
real(kind=r8), intent(out) omega_ce,
real(kind=r8), intent(out) omega_b,
real(kind=r8), intent(out) p_loc,
real(kind=r8), intent(out) s_loc,
real(kind=r8), intent(out) t_loc )
Here is the call graph for this function:
Here is the caller graph for this function: