First implementation of ionization boundary. Still some work to do.
This commit is contained in:
parent
61885b4a37
commit
8cf50cda68
11 changed files with 247 additions and 105 deletions
|
|
@ -108,6 +108,85 @@ MODULE moduleMeshBoundary
|
|||
|
||||
END SUBROUTINE wallTemperature
|
||||
|
||||
!Ionization surface: an electron will pass through the surface
|
||||
! and create an ion-electron pair based on a neutral background
|
||||
SUBROUTINE ionization(edge, part)
|
||||
USE moduleList
|
||||
USE moduleSpecies
|
||||
USE moduleMesh
|
||||
USE moduleRefParam
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshEdge), INTENT(inout):: edge
|
||||
CLASS(particle), INTENT(inout):: part
|
||||
REAL(8):: vRel, eRel, mRel !relative velocity, energy and mass
|
||||
REAL(8):: ionizationRate
|
||||
INTEGER:: ionizationPair, p
|
||||
TYPE(particle), POINTER:: newElectron
|
||||
TYPE(particle), POINTER:: newIon
|
||||
|
||||
SELECT TYPE(bound => edge%boundary%bTypes(part%sp)%obj)
|
||||
TYPE IS(boundaryIonization)
|
||||
mRel = (bound%m0*species(part%sp)%obj%m)*(bound%m0+species(part%sp)%obj%m)
|
||||
vRel = SUM(DABS(part%v-bound%v0))
|
||||
eRel = mRel*vRel**2*5.D-1
|
||||
|
||||
IF (eRel > bound%eThreshold) THEN
|
||||
!TODO: Check units
|
||||
ionizationRate = bound%n0*bound%crossSection%get(eRel)
|
||||
|
||||
ionizationPair = INT(ionizationRate*tauMin*ti_ref/species(bound%sp)%obj%weight)
|
||||
|
||||
!Create the new pair of particles
|
||||
DO p = 1, ionizationPair
|
||||
ALLOCATE(newElectron)
|
||||
ALLOCATE(newIon)
|
||||
|
||||
newElectron%sp = part%sp
|
||||
newIon%sp = bound%sp
|
||||
|
||||
newElectron%v = 10.D0*bound%v0 + (1.D0 + bound%deltaV/NORM2(bound%v0))
|
||||
newIon%v = bound%v0
|
||||
|
||||
newElectron%r = edge%randPos()
|
||||
newIon%r = newElectron%r
|
||||
|
||||
newElectron%vol = part%vol
|
||||
newIon%vol = part%vol
|
||||
|
||||
newElectron%xi = mesh%vols(part%vol)%obj%phy2log(newElectron%r)
|
||||
newIon%xi = newElectron%xi
|
||||
|
||||
newElectron%qm = part%qm
|
||||
SELECT TYPE(spe => species(bound%sp)%obj)
|
||||
TYPE IS(speciesCharged)
|
||||
newIon%qm = spe%qm
|
||||
|
||||
END SELECT
|
||||
|
||||
newElectron%weight = species(bound%sp)%obj%weight
|
||||
newIon%weight = newElectron%weight
|
||||
|
||||
newElectron%n_in = .TRUE.
|
||||
newIon%n_in = .TRUE.
|
||||
|
||||
!Add particles to list
|
||||
CALL OMP_SET_LOCK(lockSurfaces)
|
||||
CALL partSurfaces%add(newElectron)
|
||||
CALL partSurfaces%add(newIon)
|
||||
CALL OMP_UNSET_LOCK(lockSurfaces)
|
||||
|
||||
END DO
|
||||
|
||||
!Removes ionizing electron
|
||||
part%n_in = .FALSE.
|
||||
|
||||
END IF
|
||||
|
||||
END SELECT
|
||||
|
||||
END SUBROUTINE ionization
|
||||
|
||||
!Symmetry axis. Dummy function
|
||||
SUBROUTINE symmetryAxis(edge, part)
|
||||
USE moduleSpecies
|
||||
|
|
@ -118,4 +197,38 @@ MODULE moduleMeshBoundary
|
|||
|
||||
END SUBROUTINE symmetryAxis
|
||||
|
||||
!Points the boundary function to specific type
|
||||
SUBROUTINE pointBoundaryFunction(edge, s)
|
||||
USE moduleErrors
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshEdge), INTENT(inout):: edge
|
||||
INTEGER, INTENT(in):: s !Species index
|
||||
|
||||
SELECT TYPE(obj => edge%boundary%bTypes(s)%obj)
|
||||
TYPE IS(boundaryAbsorption)
|
||||
edge%fBoundary(s)%apply => absorption
|
||||
|
||||
TYPE IS(boundaryReflection)
|
||||
edge%fBoundary(s)%apply => reflection
|
||||
|
||||
TYPE IS(boundaryTransparent)
|
||||
edge%fBoundary(s)%apply => transparent
|
||||
|
||||
TYPE IS(boundaryWallTemperature)
|
||||
edge%fBoundary(s)%apply => wallTemperature
|
||||
|
||||
TYPE IS(boundaryIonization)
|
||||
edge%fBoundary(s)%apply => ionization
|
||||
|
||||
TYPE IS(boundaryAxis)
|
||||
edge%fBoundary(s)%apply => symmetryAxis
|
||||
|
||||
CLASS DEFAULT
|
||||
CALL criticalError("Boundary type not defined in this geometry", 'pointBoundaryFunction')
|
||||
|
||||
END SELECT
|
||||
|
||||
END SUBROUTINE pointBoundaryFunction
|
||||
|
||||
END MODULE moduleMeshBoundary
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue