I'm dying with hay fever but I have to commit
I'm feeling awful but I have work in my desktop that I need to commit so I can work with my laptop while I'm at the IEPC 2022 in Boston.
This commit is contained in:
parent
cbb5fe0bf2
commit
23e2fe9bae
17 changed files with 313 additions and 140 deletions
|
|
@ -78,6 +78,14 @@ MODULE moduleCollisions
|
|||
|
||||
END TYPE interactionsBinary
|
||||
|
||||
!Type to count number of collisions
|
||||
TYPE:: tallyCollisions
|
||||
INTEGER, ALLOCATABLE:: tally(:)
|
||||
|
||||
END TYPE
|
||||
|
||||
!Number of collision pairs (nSpecies*(nSpecies+1)/2)
|
||||
INTEGER:: nCollPairs = 0
|
||||
!Collision 'Matrix'. A symmetric 2D matrix put into a 1D array to save memory
|
||||
TYPE(interactionsBinary), ALLOCATABLE, TARGET:: interactionMatrix(:)
|
||||
!Folder for collision cross section tables
|
||||
|
|
@ -120,10 +128,9 @@ MODULE moduleCollisions
|
|||
IMPLICIT NONE
|
||||
|
||||
TYPE(interactionsBinary), INTENT(inout), ALLOCATABLE:: interactionMatrix(:)
|
||||
INTEGER:: nInteractions
|
||||
|
||||
nInteractions = (nSpecies*(nSpecies+1))/2
|
||||
ALLOCATE(interactionMatrix(1:nInteractions))
|
||||
nCollPairs = (nSpecies*(nSpecies+1))/2
|
||||
ALLOCATE(interactionMatrix(1:nCollPairs))
|
||||
|
||||
interactionMatrix(:)%amount = 0
|
||||
interactionMatrix(:)%rMass = 0.D0
|
||||
|
|
@ -222,8 +229,7 @@ MODULE moduleCollisions
|
|||
TYPE(particle), INTENT(inout), TARGET:: part_i, part_j
|
||||
REAL(8), INTENT(in):: vRel
|
||||
REAL(8):: m_i, m_j
|
||||
REAL(8), DIMENSION(1:3):: vCM
|
||||
REAL(8):: vp(1:3)
|
||||
REAL(8), DIMENSION(1:3):: vCM, vp
|
||||
|
||||
m_i = part_i%species%m
|
||||
m_j = part_j%species%m
|
||||
|
|
@ -232,13 +238,8 @@ MODULE moduleCollisions
|
|||
vp = vRel*randomDirectionVHS()
|
||||
|
||||
!Assign velocities to particles
|
||||
PRINT *, part_i%v
|
||||
part_i%v = vCM + m_j*vp / (m_i + m_j)
|
||||
PRINT *, part_i%v
|
||||
PRINT *, part_j%v
|
||||
part_j%v = vCM - m_i*vp / (m_i + m_j)
|
||||
PRINT *, part_j%v
|
||||
PRINT *
|
||||
|
||||
END SUBROUTINE collideBinaryElastic
|
||||
|
||||
|
|
@ -273,16 +274,21 @@ MODULE moduleCollisions
|
|||
!Input energy is in eV. Convert to J with ev2J and then to
|
||||
!non-dimensional units.
|
||||
collision%eThreshold = energyThreshold*eV2J/(m_ref*v_ref**2)
|
||||
!species for impacting electron
|
||||
electronIndex = speciesName2Index(electron)
|
||||
SELECT TYPE(sp => species(electronIndex)%obj)
|
||||
TYPE IS(speciesCharged)
|
||||
collision%electron => sp
|
||||
|
||||
CLASS DEFAULT
|
||||
CALL criticalError("Species " // sp%name // " chosen for ionization is not a charged species", 'initBinaryIonization')
|
||||
CALL criticalError("Species " // sp%name // " chosen for " // &
|
||||
"secondary electron is not a charged species", 'initBinaryIonization')
|
||||
|
||||
END SELECT
|
||||
|
||||
!momentum change per ionization process
|
||||
collision%deltaV = sqrt(collision%eThreshold / collision%electron%m)
|
||||
|
||||
END SELECT
|
||||
|
||||
END SUBROUTINE initBinaryIonization
|
||||
|
|
@ -302,8 +308,8 @@ MODULE moduleCollisions
|
|||
REAL(8), INTENT(in):: vRel
|
||||
REAL(8):: rMass, eRel
|
||||
TYPE(particle), POINTER:: electron => NULL(), neutral => NULL()
|
||||
REAL(8), DIMENSION(1:3):: vChange
|
||||
TYPE(particle), POINTER:: newElectron
|
||||
REAL(8), DIMENSION(1:3):: vp_e, vp_n
|
||||
|
||||
rMass = reducedMass(part_i%species%m, part_j%species%m)
|
||||
eRel = rMass*vRel**2
|
||||
|
|
@ -322,35 +328,35 @@ MODULE moduleCollisions
|
|||
|
||||
END IF
|
||||
|
||||
!Exchange energy between
|
||||
vp_e = electron%v*(1.D0 - self%deltaV/NORM2(electron%v))
|
||||
vp_n = neutral%v* (1.D0 + self%deltaV/NORM2(neutral%v) )
|
||||
|
||||
!Changes velocity of impacting electron
|
||||
electron%v = vp_e
|
||||
|
||||
!Creates a new electron from ionization
|
||||
ALLOCATE(newElectron)
|
||||
newElectron%species => electron%species
|
||||
newElectron%v = vp_n
|
||||
newElectron%r = neutral%r
|
||||
newElectron%xi = neutral%xi
|
||||
newElectron%n_in = .TRUE.
|
||||
newElectron%vol = neutral%vol
|
||||
newElectron%volColl = neutral%volColl
|
||||
newElectron%weight = neutral%weight
|
||||
newElectron%qm = electron%qm
|
||||
|
||||
!Ionize neutral particle
|
||||
SELECT TYPE(sp => neutral%species)
|
||||
TYPE IS(speciesNeutral)
|
||||
CALL sp%ionize(neutral)
|
||||
|
||||
CLASS DEFAULT
|
||||
CALL criticalError(sp%name // " is not a neutral", 'collideBinaryIonization')
|
||||
! CALL criticalError(sp%name // " is not a neutral", 'collideBinaryIonization')
|
||||
RETURN
|
||||
|
||||
END SELECT
|
||||
|
||||
!Exchange of velocity between particles
|
||||
vChange = self%deltaV*randomDirectionVHS()
|
||||
|
||||
!Energy is loss by the primary electron
|
||||
electron%v = electron%v - vChange
|
||||
|
||||
!Creates a new electron from ionization
|
||||
ALLOCATE(newElectron)
|
||||
newElectron%species => electron%species
|
||||
!Secondary electorn gains energy from ionization
|
||||
newElectron%v = vChange
|
||||
newElectron%r = neutral%r
|
||||
newElectron%xi = neutral%xi
|
||||
newElectron%n_in = .TRUE.
|
||||
newElectron%vol = neutral%vol
|
||||
newElectron%volColl = neutral%volColl
|
||||
newElectron%weight = neutral%weight
|
||||
|
||||
!Adds new electron to list of new particles from collisions
|
||||
CALL OMP_SET_LOCK(lockCollisions)
|
||||
CALL partCollisions%add(newElectron)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue