Input done

The input is done and testing.

WARNING: Velocity of secondary electrons is still a dummy one!
This commit is contained in:
Jorge Gonzalez 2023-07-17 22:48:52 +02:00
commit cc3e28e5e7
2 changed files with 27 additions and 5 deletions

View file

@ -806,7 +806,7 @@ MODULE moduleInput
REAL(8):: effTime
REAL(8):: eThreshold !Energy threshold
INTEGER:: speciesID
CHARACTER(:), ALLOCATABLE:: speciesName, crossSection
CHARACTER(:), ALLOCATABLE:: speciesName, crossSection, yield
LOGICAL:: found
INTEGER:: nTypes
@ -872,6 +872,15 @@ MODULE moduleInput
CALL initWallTemperature(boundary(i)%bTypes(s)%obj, Tw, cw)
CASE('secondaryEmission')
CALL config%get(object // '.yield', yield, found)
IF (.NOT. found) CALL criticalError("missing parameter 'yield' for secondary emission", 'readBoundary')
CALL config%get(object // '.electron', speciesName, found)
IF (.NOT. found) CALL criticalError("missing parameter 'electron' for secondary emission", 'readBoundary')
speciesID = speciesName2Index(speciesName)
CALL initSEE(boundary(i)%bTypes(s)%obj, yield, speciesID)
CASE('axis')
ALLOCATE(boundaryAxis:: boundary(i)%bTypes(s)%obj)

View file

@ -220,7 +220,9 @@ MODULE moduleMeshBoundary
CLASS(meshEdge), INTENT(inout):: edge
CLASS(particle), INTENT(inout):: part
REAL(8):: vRel, eRel
INTEGER:: yield
REAL(8):: yield
INTEGER:: nNewElectrons
REAL(8), ALLOCATABLE:: weight(:)
INTEGER:: p
REAL(8), DIMENSION(1:3):: rElectron, XiElectron!Position of new electrons
INTEGER:: cell
@ -234,8 +236,19 @@ MODULE moduleMeshBoundary
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)
yield = part%weight*bound%yield%get(eRel)
nNewElectrons = FLOOR(yield / bound%electron%weight)
IF (REAL(nNewElectrons) * bound%electron%weight < yield) THEN
nNewElectrons = nNewElectrons + 1
ALLOCATE(weight(1:nNewElectrons))
weight(1:nNewElectrons-1) = bound%electron%weight
weight(nNewElectrons) = yield - SUM(weight(1:nNewElectrons-1))
ELSE
ALLOCATE(weight(1:nNewElectrons))
weight(1:nNewElectrons) = bound%electron%weight
END IF
!position of impacting ion
rElectron = edge%intersection(part%r)
@ -250,7 +263,7 @@ MODULE moduleMeshBoundary
END IF
DO p = 1, yield
DO p = 1, nNewElectrons
!Create new macro-particle
ALLOCATE(secondaryElectron)
@ -265,7 +278,7 @@ MODULE moduleMeshBoundary
secondaryElectron%cell = cell
!Assign weight
secondaryElectron%weight = bound%electron%weight
secondaryElectron%weight = weight(p)
!Assume particle is inside the numerical domain
secondaryElectron%n_in = .TRUE.