Commit 71b5e608 authored by Caneses Marin, Juan Francisco's avatar Caneses Marin, Juan Francisco
Browse files

changed "in" to "params"

parent cd37c678
Loading
Loading
Loading
Loading
+53 −53
Original line number Diff line number Diff line
&in_nml
&params_nml
! Simulation name:
! ===============
in%fileDescriptor = '2021_02_17b',
params%fileDescriptor = '2021_02_17b',

! Magnetic field input data:
! =========================
in%repoDir ="/home/nfc/myRepos/LinearFokkerPlanck_Axisymmetric",
in%BFieldFileDir = "/BfieldData",
in%BFieldFile = "/Bfield_b.txt",
in%nz = 501,			                                                              ! Number of points in BFieldFile
params%repoDir ="/home/nfc/myRepos/LinearFokkerPlanck_Axisymmetric",
params%BFieldFileDir = "/BfieldData",
params%BFieldFile = "/Bfield_b.txt",
params%nz = 501,			                                                              ! Number of points in BFieldFile

! Simulation conditions:
! =====================
in%Nparts = 70000,                                                              ! Total number of particles
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,
params%Nparts = 70000,                                                              ! Total number of particles
params%Nsteps = 10000,                                                               ! Total number of time steps
params%dt     = 0.5E-7,                                                             ! Time step in [s]
params%zmax   = +5.0,
params%zmin   = -5.0,

in%iSave = .true.,
in%iPush = .true.,                                                             ! Enable RK4 particle pusher
in%iColl = .true.,                                                             ! Collisions or no collisions
in%iHeat = .true.,                                                            ! Enable RF heating operator
in%iPotential = .false.,                                                       ! Enable electric potential
in%iDrag = .true.,                                                            ! Enable plasma drag
params%iSave = .true.,
params%iPush = .true.,                                                             ! Enable RK4 particle pusher
params%iColl = .true.,                                                             ! Collisions or no collisions
params%iHeat = .true.,                                                            ! Enable RF heating operator
params%iPotential = .false.,                                                       ! Enable electric potential
params%iDrag = .true.,                                                            ! Enable plasma drag

! Time steps to record:
! ==============
in%jstart = 1,                                                                  ! start frame
in%jend   = 10000,                                                               ! end frame
in%jincr  = 250,                                                                 ! increment
params%jstart = 1,                                                                  ! start frame
params%jend   = 10000,                                                               ! end frame
params%jincr  = 250,                                                                 ! increment

! Collision operator conditions:
! ==============================
in%Te0 = 10.,	                                                                 ! eV
in%Ti0 = 10.,                                                                  ! eV
in%ne0 = 3.0E+19,	                                                             ! m**-3
in%Aion = 1.,                                                                  ! Ion mass
in%Zion = 1.,                                                                  ! Charge number for main ion species
in%species_a = 2,                                                              ! =1 for electrons, =2 for ions
in%elevel = 10,                                                                ! Energy at which slowing down power is calculated E = elevel*Te0
in%CollOperType = 2,                                                           ! 1 for Boozer-Only, 2 for Boozer-Kim
params%Te0 = 10.,	                                                                 ! eV
params%Ti0 = 10.,                                                                  ! eV
params%ne0 = 3.0E+19,	                                                             ! m**-3
params%Aion = 1.,                                                                  ! Ion mass
params%Zion = 1.,                                                                  ! Charge number for main ion species
params%species_a = 2,                                                              ! =1 for electrons, =2 for ions
params%elevel = 10,                                                                ! Energy at which slowing down power is calculated E = elevel*Te0
params%CollOperType = 2,                                                           ! 1 for Boozer-Only, 2 for Boozer-Kim

! Particle Boundary Conditions:
! ============================
in%BC_Type    = 1,                                                             ! 1: Isotropic plasma source, 2: NBI, 3: Periodic
in%BC_zp_mean = 0.0,                                                           ! Mean particle injection
in%BC_zp_std  = 0.3,                                                           ! STD of particle injection
in%BC_Ep      = 20000.,                                                        ! Drift kinetic energy
in%BC_Tp      = 10,                                                            ! Thermal kinetic energy
in%BC_xip     = 0.707,                                                         ! Mean pitch angle where xip = cos(theta) = vpar/v
params%BC_Type    = 1,                                                             ! 1: Isotropic plasma source, 2: NBI, 3: Periodic
params%BC_zp_mean = 0.0,                                                           ! Mean particle injection
params%BC_zp_std  = 0.3,                                                           ! STD of particle injection
params%BC_Ep      = 20000.,                                                        ! Drift kinetic energy
params%BC_Tp      = 10,                                                            ! Thermal kinetic energy
params%BC_xip     = 0.707,                                                         ! Mean pitch angle where xip = cos(theta) = vpar/v

! Particle Initial Conditions:
!===================
in%IC_Type    = 1,                                                             ! 1: uniform load, 2: gaussian load
in%IC_zp_mean = 0.0,                                                           ! Mean particle injection
in%IC_zp_std  = 0.3,                                                           ! STD of particle injection
in%IC_Ep      = 0.,                                                            ! Drift kinetic energy
in%IC_Tp      = 10,                                                            ! Thermal kinetic energy
in%IC_xip     = 0.707,                                                         ! Mean pitch angle where xip = cos(theta) = vpar/v
params%IC_Type    = 1,                                                             ! 1: uniform load, 2: gaussian load
params%IC_zp_mean = 0.0,                                                           ! Mean particle injection
params%IC_zp_std  = 0.3,                                                           ! STD of particle injection
params%IC_Ep      = 0.,                                                            ! Drift kinetic energy
params%IC_Tp      = 10,                                                            ! Thermal kinetic energy
params%IC_xip     = 0.707,                                                         ! Mean pitch angle where xip = cos(theta) = vpar/v

! RF heating operator conditions:
! ===============================
in%f_RF  = 12.195E+6                                                              ! RF frequency
in%zRes1 = 0.                                                                 ! Defines interval where RF is present
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    = 5000                                                                ! EBW E-minus wave electric field magnitude
in%n_harmonic = 2                                                              ! Cyclotron harmonic
params%f_RF  = 12.195E+6                                                              ! RF frequency
params%zRes1 = 0.                                                                 ! Defines interval where RF is present
params%zRes2 = +1.5                                                                 ! Defines interval where RF is present
params%kper  = 125.                                                               ! Perpendicular wave number of EBW
params%kpar  = 30.                                                                ! Parallel wave number of EBW
params%Ew    = 5000                                                                ! EBW E-minus wave electric field magnitude
params%n_harmonic = 2                                                              ! Cyclotron harmonic

! Electric potential conditions:
! =============================
in%s1 = 0,
in%s2 = 1.3,
in%s3 = 4.0,
in%phi1 = 0.,
in%phi2 = 0,
in%phi3 = 0.,
params%s1 = 0,
params%s2 = 1.3,
params%s3 = 4.0,
params%phi1 = 0.,
params%phi2 = 0,
params%phi3 = 0.,

/

src/.MoveParticlePack.f90.swp

deleted100644 → 0
−1 KiB

File deleted.

+21 −21
Original line number Diff line number Diff line
! =======================================================================================================
SUBROUTINE collisionOperator(i,plasma,ecnt,pcnt,in0)
SUBROUTINE collisionOperator(i,plasma,ecnt,pcnt,params)
! =======================================================================================================

USE local
@@ -11,7 +11,7 @@ IMPLICIT NONE
! Define interface variables:
INTEGER(i4)    , INTENT(IN)    :: i
TYPE(plasmaTYP), INTENT(INOUT) :: plasma
TYPE(inTYP)    , INTENT(IN)    :: in0
TYPE(paramsTYP), INTENT(IN)    :: params
REAL(r8)       , INTENT(INOUT) :: ecnt, pcnt

! Define local variables:
@@ -38,13 +38,13 @@ xip0 = plasma%xip(i)

! Test particle properties:
! -----------------------------------------------------------------------------------------------------------------
Ma = in0%Ma
qa = in0%qa
species_a = in0%species_a
Ma = params%Ma
qa = params%qa
species_a = params%species_a
if (species_a .EQ. 1) then      ! Test electrons
   Za = -1.
else if (species_a .EQ. 1) then ! Test ions
   Za = in0%Zion
   Za = params%Zion
end if

species_b_loop: do ss = 1,2
@@ -55,14 +55,14 @@ if (ss .EQ. 2) species_b = 2

if(species_b .EQ. 1) then       ! Background electron
  Mb = m_e
  Tb = in0%Te0
  Tb = params%Te0
  Zb = -1.
  nb = in0%ne0
  nb = params%ne0
else if(species_b .EQ. 2) then  ! Background ion
  Mb = in0%Aion*m_p
  Tb = in0%Ti0
  Zb = in0%Zion
  nb = in0%ne0
  Mb = params%Aion*m_p
  Tb = params%Ti0
  Zb = params%Zion
  nb = params%ne0
end if

! Coordinate systems:
@@ -80,11 +80,11 @@ vpar = xip0*v
vper = sqrt(1 - (xip0**2.) )*v

! Plasma drift in the lab frame:
if (in0%iDrag) then
   if (zp0 .GE. in0%BC_zp_mean) then
      u = +1.*sqrt( e_c*(in0%Te0 + in0%Ti0)/(in0%Aion*m_p) )
if (params%iDrag) then
   if (zp0 .GE. params%BC_zp_mean) then
      u = +1.*sqrt( e_c*(params%Te0 + params%Ti0)/(params%Aion*m_p) )
   else
      u = -1.*sqrt( e_c*(in0%Te0 + in0%Ti0)/(in0%Aion*m_p) )
      u = -1.*sqrt( e_c*(params%Te0 + params%Ti0)/(params%Aion*m_p) )
   end if
else
   u = 0.
@@ -118,7 +118,7 @@ xsi2 = sign(1._r8, ran_num - 0.5_r8)

! Apply pitch angle scattering in plasma frame:
! ---------------------------------------------
d1 = nu_D(xab,nb,Tb,Mb,Zb,Za,Ma)*in0%dt
d1 = nu_D(xab,nb,Tb,Mb,Zb,Za,Ma)*params%dt
S1 = xip_pf_0*(1. - d1)
S2 = ( 1. - xip_pf_0*xip_pf_0 )*d1
S3 = xsi1*sqrt(S2)
@@ -127,10 +127,10 @@ xip_pf_1 = S1 + S3
! Apply energy scattering in plasma frame:
! ----------------------------------------
! Select mass term
if (in0%CollOperType .EQ. 1) mass_term = 1.                 ! Boozer-Only term
if (in0%CollOperType .EQ. 2) mass_term = 1. + (Mb/Ma)   ! Boozer-Kim term
if (params%CollOperType .EQ. 1) mass_term = 1.                 ! Boozer-Only term
if (params%CollOperType .EQ. 2) mass_term = 1. + (Mb/Ma)   ! Boozer-Kim term

d2 = nu_E(xab,nb,Tb,Mb,Zb,Za,Ma)*in0%dt/mass_term
d2 = nu_E(xab,nb,Tb,Mb,Zb,Za,Ma)*params%dt/mass_term
E0 = (1.5 + E_nuE_d_nu_E_dE(xab))*Tb
E1 = d2*(kep_pf_0 - E0)
E2 = sqrt(Tb*kep_pf_0*d2)
@@ -146,7 +146,7 @@ end if
if (kep_pf_1 .le. 0.) kep_pf_1 = kep_pf_0

! Record energy loss due to collisions in the plasma frame:
if (kep_pf_1 .GT. in0%elevel*Tb) then
if (kep_pf_1 .GT. params%elevel*Tb) then
	! Record slowing down energy during time step dt
	ecnt = ecnt + dE_pf
	! Count how many particles are involved in the slowing down power calculation
+9 −10
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ USE local
USE spline_fits

IMPLICIT NONE
TYPE inTYP
TYPE paramsTYP
  CHARACTER*150 :: fileDescriptor, repoDir
  CHARACTER*150 :: BFieldFile, BFieldFileDir
  REAL(r8) :: Ti0, Te0, ne0, dt
@@ -235,10 +235,9 @@ TYPE inTYP
  INTEGER(i4) :: n_harmonic
  REAL(r8) :: tComputeTime, tSimTime                              ! Variables to hold cpu time at start and end of computation
  REAL(r8) :: Ma, qa
END TYPE inTYP
END TYPE paramsTYP
  
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
@@ -256,17 +255,17 @@ END TYPE fieldSplineTYP

CONTAINS
! ----------------------------------------------------------------------------
SUBROUTINE InitPlasma(plasma,in)
SUBROUTINE InitPlasma(plasma,params)
   IMPLICIT NONE
   ! Declare interface variables:
   TYPE(plasmaTYP), INTENT(INOUT) :: plasma
   TYPE(inTYP)    , INTENT(IN)    :: in
   TYPE(paramsTYP), INTENT(IN)    :: params

   ! Declare local variables:
   INTEGER(i4) :: NC, NS

   NC = in%Nparts
   NS = in%Nsteps
   NC = params%Nparts
   NS = params%Nsteps
   
   ! Allocate memory: 
   ALLOCATE(plasma%zp(NC) ,plasma%kep(NC),plasma%xip(NC),plasma%a(NC)      )
@@ -284,19 +283,19 @@ SUBROUTINE InitPlasma(plasma,in)
END SUBROUTINE InitPlasma

! --------------------------------------------------------------------------
SUBROUTINE InitFieldSpline(fieldspline,in)
SUBROUTINE InitFieldSpline(fieldspline,params)
   USE spline_fits   

   IMPLICIT NONE
   ! Declare interface variables:
   TYPE(fieldSplineTYP), INTENT(INOUT) :: fieldspline
   TYPE(inTYP)         , INTENT(IN)    :: in
   TYPE(paramsTYP)     , INTENT(IN)    :: params

   ! Declare local variables:
   INTEGER(i4) :: NZ
   
   ! Size of spline data:
   NZ = in%nz
   NZ = params%nz
   
   ! Allocate memory: 
   CALL InitSpline(fieldspline%B  ,NZ,0._8,0._8)
+62 −65

File changed.

Preview size limit exceeded, changes collapsed.

Loading