Alphie grid case and issues
Output for the example ALPHIE_Grid. Found an issue when multiple injections were used with species with different time steps. Modification to the way to compute the ionization boundary: The maximum number of ionizations is computed by eRel/eThreshold (relative energy / threshold of ionization) For each possible ionization, the probability of ionization is computed based on the density of neutrals, cross section and effective time divided by the number of maximum ionizations. If an ionization takes place, the ionization energy is substracted from the relative energy.
This commit is contained in:
parent
1587d57cc7
commit
924ba4e20e
12 changed files with 16778 additions and 1365 deletions
|
|
@ -110,31 +110,34 @@ MODULE moduleMeshBoundary
|
|||
USE moduleMesh
|
||||
USE moduleRefParam
|
||||
USE moduleRandom
|
||||
USE moduleMath
|
||||
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
|
||||
REAL(8):: nIonizations !Number of ionizations based on eRel
|
||||
REAL(8):: pIonization !Probability of ionization of each event
|
||||
INTEGER:: p
|
||||
REAL(8):: v0(1:3) !random velocity of neutral
|
||||
TYPE(particle), POINTER:: newElectron
|
||||
TYPE(particle), POINTER:: newIon
|
||||
|
||||
SELECT TYPE(bound => edge%boundary%bTypes(part%species%n)%obj)
|
||||
TYPE IS(boundaryIonization)
|
||||
mRel = (bound%m0*part%species%m)*(bound%m0+part%species%m)
|
||||
mRel = reducedMass(bound%m0, part%species%m)
|
||||
vRel = SUM(DABS(part%v-bound%v0))
|
||||
eRel = mRel*vRel**2*5.D-1
|
||||
|
||||
IF (eRel > bound%eThreshold) THEN
|
||||
ionizationRate = part%weight*bound%n0*bound%crossSection%get(eRel)*vRel
|
||||
!Maximum number of possible ionizations based on relative energy
|
||||
nIonizations = eRel/bound%eThreshold
|
||||
|
||||
!Rounds the number of particles up
|
||||
ionizationPair = NINT(ionizationRate*bound%effectiveTime/bound%species%weight)
|
||||
DO p = 1, FLOOR(nIonizations)
|
||||
!Get probability of ionization
|
||||
pIonization = 1.D0 - DEXP(-bound%n0*bound%crossSection%get(eRel)*vRel*bound%effectiveTime/nIonizations)
|
||||
|
||||
!Create the new pair of particles
|
||||
DO p = 1, ionizationPair
|
||||
!If a random number is below the probability of ionization, create new pair of ion-electron
|
||||
IF (random() < pIonization) THEN
|
||||
!Assign random velocity to the neutral
|
||||
v0(1) = bound%v0(1) + bound%vTh*randomMaxwellian()
|
||||
v0(2) = bound%v0(2) + bound%vTh*randomMaxwellian()
|
||||
|
|
@ -159,7 +162,7 @@ MODULE moduleMeshBoundary
|
|||
newElectron%xi = mesh%vols(part%vol)%obj%phy2log(newElectron%r)
|
||||
newIon%xi = newElectron%xi
|
||||
|
||||
newElectron%weight = bound%species%weight
|
||||
newElectron%weight = part%weight
|
||||
newIon%weight = newElectron%weight
|
||||
|
||||
newElectron%n_in = .TRUE.
|
||||
|
|
@ -171,9 +174,13 @@ MODULE moduleMeshBoundary
|
|||
CALL partSurfaces%add(newIon)
|
||||
CALL OMP_UNSET_LOCK(lockSurfaces)
|
||||
|
||||
END DO
|
||||
!Electron loses energy due to ionization
|
||||
eRel = eRel - bound%eThreshold
|
||||
vRel = 2.D0*DSQRT(eRel)/mRel
|
||||
|
||||
END IF
|
||||
END IF
|
||||
|
||||
END DO
|
||||
|
||||
END SELECT
|
||||
|
||||
|
|
|
|||
|
|
@ -252,12 +252,22 @@ MODULE moduleInject
|
|||
CLASS(injectGeneric), INTENT(in):: self
|
||||
INTEGER:: randomX
|
||||
INTEGER, SAVE:: nMin, nMax !Min and Max index in partInj array
|
||||
INTEGER:: i
|
||||
INTEGER:: n, sp
|
||||
CLASS(meshEdge), POINTER:: randomEdge
|
||||
|
||||
!Insert particles
|
||||
!$OMP SINGLE
|
||||
nMin = SUM(inject(1:(self%id-1))%nParticles) + 1
|
||||
nMin = 0
|
||||
DO i = 1, self%id -1
|
||||
IF (solver%pusher(inject(i)%species%n)%pushSpecies) THEN
|
||||
nMin = nMin + inject(i)%nParticles
|
||||
|
||||
END IF
|
||||
|
||||
END DO
|
||||
|
||||
nMin = nMin + 1
|
||||
nMax = nMin + self%nParticles - 1
|
||||
!Assign weight to particle.
|
||||
partInj(nMin:nMax)%weight = self%species%weight
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue