Commit 6590deac authored by Caneses Marin, Juan Francisco's avatar Caneses Marin, Juan Francisco
Browse files

Using plasmaTYP with particle pusher, cyclotron nymbre and collisions. Results...

Using plasmaTYP with particle pusher, cyclotron nymbre and collisions. Results validated. Not applied to RF operator yet
parent 4c8ef99d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
&in_nml
! Simulation name:
! ===============
in%fileDescriptor = '2021_02_10b',
in%fileDescriptor = '2021_02_16a',

! Magnetic field input data:
! =========================
@@ -12,7 +12,7 @@ in%nz = 501, ! N

! Simulation conditions:
! =====================
in%Nparts = 50000,                                                              ! Total number of particles
in%Nparts = 10000,                                                              ! Total number of particles
in%Nsteps = 50000,                                                               ! Total number of time steps
in%dt     = 1.5E-7,                                                             ! Time step in [s]
in%zmax = +2.0,
+2 −2
Original line number Diff line number Diff line
&in_nml
! Simulation name:
! ===============
in%fileDescriptor = '2021_02_09b',
in%fileDescriptor = '2021_02_16c',

! Magnetic field input data:
! =========================
+7 −7
Original line number Diff line number Diff line
&in_nml
! Simulation name:
! ===============
in%fileDescriptor = '2021_02_11d',
in%fileDescriptor = '2021_02_16b',

! Magnetic field input data:
! =========================
@@ -13,7 +13,7 @@ in%nz = 501, ! N
! Simulation conditions:
! =====================
in%Nparts = 70000,                                                              ! Total number of particles
in%Nsteps = 20000,                                                               ! Total number of time steps
in%Nsteps = 10000,                                                               ! Total number of time steps
in%dt     = 0.5E-7,                                                             ! Time step in [s]
in%zmax   = +5.0,
in%zmin   = -5.0,
@@ -28,8 +28,8 @@ in%iDrag = .true., !
! Time steps to record:
! ==============
in%jstart = 1,                                                                  ! start frame
in%jend   = 20000,                                                               ! end frame
in%jincr  = 200,                                                                 ! increment
in%jend   = 10000,                                                               ! end frame
in%jincr  = 250,                                                                 ! increment

! Collision operator conditions:
! ==============================
@@ -67,7 +67,7 @@ in%zRes1 = 0. !
in%zRes2 = +1.5                                                                 ! Defines interval where RF is present
in%kper  = 125.                                                               ! Perpendicular wave number of EBW
in%kpar  = 30.                                                                ! Parallel wave number of EBW
in%Ew    = 4000                                                                ! EBW E-minus wave electric field magnitude
in%Ew    = 5000                                                                ! EBW E-minus wave electric field magnitude
in%n_harmonic = 2                                                              ! Cyclotron harmonic

! Electric potential conditions:
+15 −4
Original line number Diff line number Diff line
! =======================================================================================================
SUBROUTINE collisionOperator(zp0,kep0,xip0,ecnt,pcnt,in0)
SUBROUTINE collisionOperator(i,plasma,ecnt,pcnt,in0)
! =======================================================================================================

USE local
@@ -9,11 +9,13 @@ USE dataTYP
IMPLICIT NONE

! Define interface variables:
INTEGER(i4)    , INTENT(IN)    :: i
TYPE(plasmaTYP), INTENT(INOUT) :: plasma
TYPE(inTYP)    , INTENT(IN)    :: in0
REAL(r8), INTENT(IN) :: zp0
REAL(r8), INTENT(INOUT) :: xip0, kep0, ecnt, pcnt
REAL(r8)       , INTENT(INOUT) :: ecnt, pcnt

! Define local variables:
REAL(r8) :: zp0, xip0, kep0
INTEGER(i4) :: species_a, species_b, ss
REAL(r8) :: Za, Ma, qa
REAL(r8) :: Zb, Mb, Tb, nb
@@ -29,6 +31,11 @@ REAL(r8) :: dE_pf, dE_lf
! Define functions:
REAL(r8) :: lnA, phi, phip, phi2p, Gb, E_nuE_d_nu_E_dE

! Input variables:
zp0  = plasma%zp(i)
kep0 = plasma%kep(i)
xip0 = plasma%xip(i)

! Test particle properties:
! -----------------------------------------------------------------------------------------------------------------
Ma = in0%Ma
@@ -166,6 +173,10 @@ kep0 = 0.5*(Ma/e_c)*v**2.

end do species_b_loop

! Output data from calculation:
plasma%xip(i) = vpar/v
plasma%kep(i) = 0.5*(Ma/e_c)*v**2.

RETURN
END SUBROUTINE collisionOperator

+14 −1
Original line number Diff line number Diff line
@@ -55,6 +55,19 @@ TYPE inTYP
  REAL(r8) :: Ma, qa
END TYPE inTYP
  
TYPE plasmaTYP
 TYPE(inTYP) :: in
 REAL(r8) :: NC, Nsteps, dt
 REAL(r8)   , DIMENSION(:), ALLOCATABLE :: zp, kep, xip, a
 INTEGER(i4), DIMENSION(:), ALLOCATABLE :: f1 , f2 , f3 , f4
 REAL(r8)   , DIMENSION(:), ALLOCATABLE :: dE1, dE2, dE3, dE4, dE3_hat
 REAL(r8)   , DIMENSION(:), ALLOCATABLE :: tau, Jm, rL, doppler
 REAL(r8)   , DIMENSION(:), ALLOCATABLE :: NR , NSP
 REAL(r8)   , DIMENSION(:), ALLOCATABLE :: Eplus, Eminus
 REAL(r8)   , DIMENSION(:), ALLOCATABLE :: Ndot1, Ndot2, Ndot3, Ndot4
 REAL(r8)   , DIMENSION(:), ALLOCATABLE :: Edot1, Edot2, Edot3, Edot4, Edot3_hat
END TYPE plasmaTYP

END MODULE dataTYP

! MODULE spline_fits
Loading