Function to create electrons

Still required to assign velocity:
  - In the direction normal to the surface
  - Which energy?
This commit is contained in:
Jorge Gonzalez 2023-07-17 13:58:57 +02:00
commit e369bccf78
2 changed files with 88 additions and 1 deletions

View file

@ -212,6 +212,79 @@ MODULE moduleMeshBoundary
END SUBROUTINE symmetryAxis
SUBROUTINE secondaryEmission(edge, part)
USE moduleSpecies
IMPLICIT NONE
CLASS(meshEdge), INTENT(inout):: edge
CLASS(particle), INTENT(inout):: part
REAL(8):: vRel, eRel
INTEGER:: yield
INTEGER:: p
REAL(8), DIMENSION(1:3):: rElectron, XiElectron!Position of new electrons
INTEGER:: cell
TYPE(particle), POINTER:: secondaryElectron
SELECT TYPE(bound => edge%boundary%bTypes(part%species%n)%obj)
TYPE IS(boundarySEE)
!Get relative velocity
vRel = NORM2(part%v)
!Convert to relative energy
eRel = part%species%m*vRel**2*5.D-1
!Get number of secondary electrons macro-particles
yield = INT(part%weight*bound%yield%get(eRel) / bound%electron%weight)
!position of impacting ion
rElectron = edge%intersection(part%r)
XiElectron = mesh%cells(part%cell)%obj%phy2log(rElectron)
!New cell of origin
IF (ASSOCIATED(edge%e1)) THEN
cell = edge%e1%n
ELSEIF (ASSOCIATED(edge%e2)) THEN
cell = edge%e2%n
END IF
DO p = 1, yield
!Create new macro-particle
ALLOCATE(secondaryElectron)
!Assign species to electron
secondaryElectron%species => bound%electron
!Assign position to particle
secondaryElectron%r = rElectron
secondaryElectron%Xi = XiElectron
!Assign cell to electron
secondaryElectron%cell = cell
!Assign weight
secondaryElectron%weight = bound%electron%weight
!Assume particle is inside the numerical domain
secondaryElectron%n_in = .TRUE.
!Assign velocity
!Add particle to list
CALL partSurfaces%setLock()
CALL partSurfaces%add(secondaryElectron)
CALL partSurfaces%unsetLock()
END DO
!Absorb impacting particle
CALL absorption(edge, part)
END SELECT
END SUBROUTINE secondaryEmission
!Points the boundary function to specific type
SUBROUTINE pointBoundaryFunction(edge, s)
USE moduleErrors
@ -239,6 +312,8 @@ MODULE moduleMeshBoundary
TYPE IS(boundaryAxis)
edge%fBoundary(s)%apply => symmetryAxis
TYPE IS(boundarySEE)
edge%fBoundary(s)%apply => secondaryEmission
CLASS DEFAULT
CALL criticalError("Boundary type not defined in this geometry", 'pointBoundaryFunction')

View file

@ -50,6 +50,7 @@ MODULE moduleBoundary
TYPE, PUBLIC, EXTENDS(boundaryGeneric):: boundarySEE
!Yield as a function of ion energy
TYPE(table1D):: yield
CLASS(speciesGeneric), POINTER:: electron !Electron species for secondary emission
CONTAINS
END TYPE boundarySEE
@ -145,13 +146,24 @@ MODULE moduleBoundary
END SUBROUTINE initIonization
SUBROUTINE initSEE(boundary, tableFile)
SUBROUTINE initSEE(boundary, tableFile, speciesID)
USE moduleRefParam
USE moduleConstParam
USE moduleSpecies
IMPLICIT NONE
CLASS(boundaryGeneric), ALLOCATABLE, INTENT(out):: boundary
CHARACTER(:), ALLOCATABLE, INTENT(in):: tableFile
INTEGER:: speciesID
ALLOCATE(boundarySEE:: boundary)
SELECT TYPE(boundary)
TYPE IS(boundarySEE)
CALL boundary%yield%init(tableFile)
CALL boundary%yield%convert(eV2J/(m_ref*v_ref**2), 1.D0)
boundary%electron => species(speciesID)%obj
END SELECT
END SUBROUTINE initSEE