Commit 733239e1 authored by Caneses Marin, Juan Francisco's avatar Caneses Marin, Juan Francisco
Browse files

Confirmed correctness of new particle loading, initial pitch angle, beam...

Confirmed correctness of new particle loading, initial pitch angle, beam energy and spread on both is consistent with MATLAB prototype script
parent 2e75e2ae
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
&in_nml
in%fileDescriptor = '2021_01_29a',
in%fileDescriptor = '2021_01_29b',

in%rootDir ="/home/nfc/myRepos/LinearFokkerPlanck_Axisymmetric",
in%BFieldFileDir = "/BfieldData",                                              ! Location of file
@@ -7,7 +7,7 @@ in%BFieldFile = "/Bfield_b.txt",
in%nz = 501,			                                                             ! Number of points in BFieldFile

in%Nparts = 50000,                                                             ! Total number of particles
in%Nsteps = 500,                                                               ! Total number of time steps
in%Nsteps = 1000,                                                               ! Total number of time steps
in%dt     = 0.5E-7,
in%threads_request = 10,                                                       ! Time step in [s]
in%particleBC = 2,                                                             ! 1: source, 2: periodic
@@ -20,8 +20,8 @@ in%iPotential = .false., !
in%iDrag = .false.,                                                            ! Enable plasma drag

in%jstart = 1,                                                                 !
in%jend   = 500,                                                               !
in%jincr  = 1,                                                                 !
in%jend   = 1000,                                                               !
in%jincr  = 4,                                                                 !

in%Te0 = 10.,	                                                                 ! eV
in%Ti0 = 10.,                                                                  ! eV
@@ -40,8 +40,8 @@ in%zp_InitType = 2, !
in%zp_init = 0.0,                                                              ! Mean particle injection
in%zp_init_std = 0.3,                                                          ! STD of particle injection
in%Ep_init = 1000.,                                                            ! Drift kinetic energy
in%Tp_init_std = 10.;                                                          ! Thermal kinetic energy
in%xip_init = 0.707,                                                           ! Mean pitch angle where xip = cos(theta) = vpar/v
in%Tp_init = 1.;                                                               ! Thermal kinetic energy
in%xip_init = 0.924,                                                           ! Mean pitch angle where xip = cos(theta) = vpar/v

in%f_RF = 28.0E+9                                                              ! RF frequency
in%zRes1 = 2.4                                                                 ! Defines interval where RF is present
+9 −9
Original line number Diff line number Diff line
@@ -333,7 +333,7 @@ SUBROUTINE loadParticles(zp,kep,xip,in0)
  TYPE(inTYP)  :: in0
  REAL(r8), DIMENSION(in0%Nparts) :: zp, kep, xip
  REAL(r8), DIMENSION(in0%Nparts) :: X1, X2, X3, X4
  REAL(r8), DIMENSION(in0%Nparts) :: R1, R2, R3, R4, t2, t4
  REAL(r8), DIMENSION(in0%Nparts) :: R_1, R_2, R_3, R_4, t_2, t_4
  REAL(r8), DIMENSION(in0%Nparts) :: wx, wy, wz, vx, vy, vz, v
  REAL(r8) :: zmin, zmax, sigma_v, m_t
  REAL(r8) :: Ux, Uy, Uz, vT, U, T, E
@@ -371,14 +371,14 @@ SUBROUTINE loadParticles(zp,kep,xip,in0)
  sigma_v = vT/sqrt(2.)

  ! Box-muller:
  R1 = sigma_v*sqrt(-2.*log(X1))
  t2 = 2.*pi*X2
  R3 = sigma_v*sqrt(-2.*log(X3))
  t4 = 2.*pi*X4

  wx = R1*cos(t2)
  wy = R1*cos(t2)
  wz = R3*cos(t4)
  R_1 = sigma_v*sqrt(-2.*log(X1))
  t_2 = 2.*pi*X2
  R_3 = sigma_v*sqrt(-2.*log(X3))
  t_4 = 2.*pi*X4

  wx = R_1*cos(t_2)
  wy = R_1*cos(t_2)
  wz = R_3*cos(t_4)

  vx = Ux + wx
  vy = Uy + wy