Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(in) | :: | params |
SUBROUTINE initialize_avalanche_params(params)
TYPE(KORC_PARAMS), INTENT(IN) :: params
!REAL(rp) :: max_pitch_angle
!REAL(rp) :: min_pitch_angle
!REAL(rp) :: max_energy
!REAL(rp) :: min_energy
!REAL(rp) :: ne
!REAL(rp) :: Zeff
!REAL(rp) :: Epar
!REAL(rp) :: Te
!REAL(rp) :: dth
!REAL(rp) :: dp
!REAL(rp) :: dR
!REAL(rp) :: dZ
!NAMELIST /AvalancheGenerationPDF/ max_pitch_angle,min_pitch_angle, &
! max_energy,min_energy,ne,Zeff,Epar,Te,dth,dp,dR,dZ
!open(unit=default_unit_open,file=TRIM(params%path_to_inputs), &
! status='OLD',form='formatted')
!read(default_unit_open,nml=AvalancheGenerationPDF)
!close(default_unit_open)
aval_params%dth = dth_aval
aval_params%dp = dp_aval
aval_params%dR = dR_aval/params%cpp%length
aval_params%dZ = dZ_aval/params%cpp%length
aval_params%max_pitch_angle = max_pitch_angle_aval
aval_params%min_pitch_angle = min_pitch_angle_aval
aval_params%max_energy = max_energy_aval*C_E ! In Joules
aval_params%ne = ne_aval
aval_params%Zeff = Zeff_aval
aval_params%Te = Te_aval*C_E ! In Joules
aval_params%lD = SQRT(C_E0*aval_params%Te/(aval_params%ne*C_E**2))
aval_params%bmin = aval_params%Zeff/(12.0_rp*C_PI*aval_params%ne* &
aval_params%lD**2)
aval_params%CoulombLog = LOG(aval_params%lD/aval_params%bmin)
aval_params%Tau = 1.0_rp/(4.0_rp*C_PI*C_C*C_RE**2*aval_params%ne* &
aval_params%CoulombLog)
aval_params%Ec = C_ME*C_C/(C_E*aval_params%Tau)
aval_params%Epar = Epar_aval
aval_params%Ebar = aval_params%Epar/aval_params%Ec
if (min_energy_aval .EQ. 0.0_rp) then
aval_params%max_p = SQRT((aval_params%max_energy/(C_ME*C_C**2))**2 &
- 1.0_rp)
! In units of mec^2
aval_params%min_p = SQRT(aval_params%Ebar - 1.0_rp)
! In units of mec^2
aval_params%min_energy = SQRT(1.0_rp + aval_params%min_p**2)*C_ME*C_C**2
else
aval_params%min_energy = min_energy_aval*C_E
! In Joules
aval_params%max_p = SQRT((aval_params%max_energy/(C_ME*C_C**2))**2 - 1.0_rp)
! In units of mec^2
aval_params%min_p = SQRT((aval_params%min_energy/(C_ME*C_C**2))**2 - 1.0_rp)
! In units of mec^2
end if
aval_params%alpha = (aval_params%Ebar - 1.0_rp)/(1.0_rp + aval_params%Zeff)
aval_params%cz = SQRT(3.0_rp*(aval_params%Zeff + 5.0_rp)/C_PI)* &
aval_params%CoulombLog
aval_params%fo = aval_params%alpha/aval_params%cz
aval_params%C1 = 0.5_rp*aval_params%alpha
aval_params%C2 = 1.0_rp/aval_params%cz - aval_params%C1
END SUBROUTINE initialize_avalanche_params