Merge branch 'improve/secondaryElectronIonization' into 'development'

Improve ionization

See merge request JorgeGonz/fpakc!47
This commit is contained in:
Jorge Gonzalez 2023-11-24 09:34:30 +00:00
commit a3d7b38e3b
6 changed files with 49 additions and 9 deletions

Binary file not shown.

View file

@ -764,6 +764,11 @@ make
\item \textbf{electron}: Character.
Name of species designed as electrons.
Only valid for \textbf{ionization} and \textbf{recombination} processes.
\item \textbf{electronSecondary}: Character.
Optional.
Name of species designed as secondary electrons.
If none provided, \textbf{electron} is used.
Only valid for \textbf{ionization}.
\end{itemize}
\end{itemize}
\item \textbf{Coulomb}: Array of objects.

View file

@ -93,7 +93,7 @@ MODULE moduleTable
f = self%fMax
ELSE
i = MINLOC(x - self%x, 1)
i = MINLOC(ABS(x - self%x), 1)
deltaX = x - self%x(i)
IF (deltaX < 0 ) THEN
i = i - 1

View file

@ -634,7 +634,7 @@ MODULE moduleInput
INTEGER:: i, k, ij
INTEGER:: pt_i, pt_j
REAL(8):: energyThreshold, energyBinding
CHARACTER(:), ALLOCATABLE:: electron
CHARACTER(:), ALLOCATABLE:: electron, electronSecondary
INTEGER:: e
CLASS(meshCell), POINTER:: cell
@ -711,8 +711,16 @@ MODULE moduleInput
IF (.NOT. found) CALL criticalError('energyThreshold not found for collision' // object, 'readInteractions')
CALL config%get(object // '.electron', electron, found)
IF (.NOT. found) CALL criticalError('electron not found for collision' // object, 'readInteractions')
CALL initBinaryIonization(interactionMatrix(ij)%collisions(k)%obj, &
crossSecFilePath, energyThreshold, electron)
CALL config%get(object // '.electronSecondary', electronSecondary, found)
IF (found) THEN
CALL initBinaryIonization(interactionMatrix(ij)%collisions(k)%obj, &
crossSecFilePath, energyThreshold, electron, electronSecondary)
ELSE
CALL initBinaryIonization(interactionMatrix(ij)%collisions(k)%obj, &
crossSecFilePath, energyThreshold, electron)
END IF
CASE ('recombination')
!Electorn impact ionization

View file

@ -911,7 +911,9 @@ MODULE moduleMesh
!Loop over collisions
DO c = 1, interactionMatrix(k)%amount
IF (rnd_real <= probabilityColl(c)) THEN
!$OMP CRITICAL
CALL interactionMatrix(k)%collisions(c)%obj%collide(part_i, part_j, vRel)
!$OMP END CRITICAL
!If collisions are gonna be output, count the collision
IF (collOutput) THEN

View file

@ -43,7 +43,8 @@ MODULE moduleCollisions
TYPE, EXTENDS(collisionBinary):: collisionBinaryIonization
REAL(8):: eThreshold !Minimum energy (non-dimensional units) required for ionization
REAL(8):: deltaV !Change in velocity due to exchange of eThreshold
CLASS(speciesCharged), POINTER:: electron !Pointer to species considerer as electrons
CLASS(speciesCharged), POINTER:: electron !Pointer to species considerer as electrons
CLASS(speciesCharged), POINTER:: electronSecondary !Pointer to species considerer as secondary electron
CONTAINS
PROCEDURE, PASS:: collide => collideBinaryIonization
@ -241,7 +242,7 @@ MODULE moduleCollisions
!ELECTRON IMPACT IONIZATION
!Inits electron impact ionization
SUBROUTINE initBinaryIonization(collision, crossSectionFilename, energyThreshold, electron)
SUBROUTINE initBinaryIonization(collision, crossSectionFilename, energyThreshold, electron, electronSecondary)
USE moduleTable
USE moduleRefParam
USE moduleConstParam
@ -253,7 +254,8 @@ MODULE moduleCollisions
CHARACTER(:), ALLOCATABLE, INTENT(in):: crossSectionFilename
REAL(8), INTENT(in):: energyThreshold
CHARACTER(:), ALLOCATABLE, INTENT(in):: electron
INTEGER:: electronIndex
CHARACTER(:), ALLOCATABLE, OPTIONAL, INTENT(in):: electronSecondary
INTEGER:: electronIndex, electronSecondaryIndex
ALLOCATE(collisionBinaryIonization:: collision)
@ -278,10 +280,27 @@ MODULE moduleCollisions
CLASS DEFAULT
CALL criticalError("Species " // sp%name // " chosen for " // &
"secondary electron is not a charged species", 'initBinaryIonization')
"impacting electron is not a charged species", 'initBinaryIonization')
END SELECT
IF (PRESENT(electronSecondary)) THEN
electronSecondaryIndex = speciesName2Index(electronSecondary)
SELECT TYPE(sp => species(electronSecondaryIndex)%obj)
TYPE IS(speciesCharged)
collision%electronSecondary => sp
CLASS DEFAULT
CALL criticalError("Species " // sp%name // " chosen for " // &
"secondary electron is not a charged species", 'initBinaryIonization')
END SELECT
ELSE
collision%electronSecondary => NULL()
END IF
!momentum change per ionization process
collision%deltaV = sqrt(collision%eThreshold / collision%electron%m)
@ -336,6 +355,12 @@ MODULE moduleCollisions
!Copy basic information from primary electron
newElectron = electron
!If secondary electron species indicates, convert
IF (ASSOCIATED(self%electronSecondary)) THEN
newElectron%species => self%electronSecondary
END IF
!Secondary electorn gains energy from ionization
newElectron%v = vChange
@ -362,7 +387,7 @@ MODULE moduleCollisions
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