diff --git a/data/collisions/RE_e-Ar+.dat b/data/collisions/RE_e-Ar+.dat new file mode 100644 index 0000000..f66bca0 --- /dev/null +++ b/data/collisions/RE_e-Ar+.dat @@ -0,0 +1,213 @@ +#Safdar Ali, Electron-ion recombination datafor plasma applications +#Relative energy (eV) Cross Section (m^2) +0.1 7.69985669590087E-19 +0.5 1.53997083398333E-19 +1.0 7.69985101243873E-20 +1.5 5.13323190330893E-20 +2.0 3.84992234874532E-20 +2.5 3.07993661600819E-20 +3.0 2.5666127941843E-20 +3.5 2.19995292145369E-20 +4.0 1.92495801690638E-20 +4.5 1.71107309114794E-20 +5.0 1.5399651505417E-20 +5.5 1.39996774459162E-20 +6.0 1.28330323963364E-20 +6.5 1.18458712005422E-20 +7.0 1.09997330327222E-20 +7.5 1.02664132872817E-20 +8.0 9.6247585100245E-21 +8.5 9.05859253009472E-21 +9.0 8.55533388127113E-21 +9.5 8.10504982706327E-21 +10.0 7.69979417827879E-21 +10.5 7.33313430557148E-21 +11.0 6.9998071485672E-21 +11.5 6.69546496173945E-21 +12.0 6.41648462381617E-21 +12.5 6.15982271292883E-21 +13.0 5.92290402595789E-21 +13.5 5.70353487135708E-21 +14.0 5.49983494208675E-21 +14.5 5.31018328380238E-21 +15.0 5.13317506940535E-21 +15.5 4.9675867398098E-21 +16.0 4.81234768081559E-21 +16.5 4.66651704964078E-21 +17.0 4.52926469088954E-21 +17.5 4.39985532406842E-21 +18.0 4.27763536651659E-21 +18.5 4.16202189315814E-21 +19.0 4.0524933394515E-21 +19.5 3.94858163465422E-21 +20.0 3.8498655150981E-21 +20.5 3.75596481600939E-21 +21.0 3.66653557878329E-21 +21.5 3.58126584096425E-21 +22.0 3.49987200031999E-21 +22.5 3.42209566370551E-21 +23.0 3.34770090694496E-21 +23.5 3.27647188451574E-21 +24.0 3.20821073802216E-21 +24.5 3.14273576077427E-21 +25.0 3.07987978261733E-21 +25.5 3.01948874478129E-21 +26.0 2.9614204391707E-21 +26.5 2.90554339037659E-21 +27.0 2.85173586190914E-21 +27.5 2.79988497084145E-21 +28.0 2.74988589731282E-21 +28.5 2.70164117724224E-21 +29.0 2.65506006820947E-21 +29.5 2.61005797982276E-21 +30.0 2.5665559610498E-21 +30.5 2.52448023797516E-21 +31.0 2.48376179629086E-21 +31.5 2.44433600354975E-21 +32.0 2.4061422668326E-21 +32.5 2.36912372201524E-21 +33.0 2.33322695128404E-21 +33.5 2.29840172594857E-21 +34.0 2.26460077194726E-21 +34.5 2.23177955574384E-21 +35.0 2.19989608857554E-21 +35.5 2.1689107472437E-21 +36.0 2.13878610983846E-21 +36.5 2.10948680496559E-21 +37.0 2.08097937319808E-21 +37.5 2.05323213961173E-21 +38.0 2.0262150963836E-21 +38.5 1.99989979453869E-21 +39.0 1.9742592440238E-21 +39.5 1.94926782137071E-21 +40.0 1.92490118428458E-21 +40.5 1.90113619255925E-21 +41.0 1.87795083477907E-21 +41.5 1.85532416031952E-21 +42.0 1.83323621620486E-21 +42.5 1.81166798842292E-21 +43.0 1.79060134733418E-21 +43.5 1.77001899684578E-21 +44.0 1.74990442705089E-21 +44.5 1.73024187006096E-21 +45.0 1.71101625878249E-21 +45.5 1.69221318841181E-21 +46.0 1.67381888044106E-21 +46.5 1.65582014898636E-21 +47.0 1.63820436926529E-21 +47.5 1.62095944806521E-21 +48.0 1.60407379605734E-21 +48.5 1.58753630182336E-21 +49.0 1.57133630747223E-21 +49.5 1.55546358573478E-21 +50.0 1.5399083184326E-21 +50.5 1.52466107622603E-21 +51.0 1.50971279955342E-21 +51.5 1.49505478068078E-21 +52.0 1.48067864678697E-21 +52.5 1.46657634401543E-21 +53.0 1.45274012242875E-21 +53.5 1.43916252180679E-21 +54.0 1.42583635823387E-21 +54.5 1.41275471142422E-21 +55.0 1.39991091273886E-21 +55.5 1.3872985338501E-21 +56.0 1.37491137601338E-21 +56.5 1.36274345990875E-21 +57.0 1.35078901601694E-21 +57.5 1.3390424754976E-21 +58.0 1.32749846153939E-21 +58.5 1.31615178115356E-21 +59.0 1.30499741738487E-21 +59.5 1.29403052191526E-21 +60.0 1.28324640803723E-21 +60.5 1.2726405439758E-21 +61.0 1.26220854653875E-21 +61.5 1.25194617507671E-21 +62.0 1.24184932573544E-21 +62.5 1.23191402598405E-21 +63.0 1.22213642940372E-21 +63.5 1.21251281072271E-21 +64.0 1.20303956108399E-21 +64.5 1.19371318353309E-21 +65.0 1.18453028871415E-21 +65.5 1.17548759076306E-21 +66.0 1.16658190338739E-21 +66.5 1.15781013612301E-21 +67.0 1.14916929075849E-21 +67.5 1.14065645791827E-21 +68.0 1.13226881379667E-21 +68.5 1.12400361703489E-21 +69.0 1.1158582057338E-21 +69.5 1.10782999459569E-21 +70.0 1.09991647218849E-21 +70.5 1.09211519832644E-21 +71.0 1.08442380156141E-21 +71.5 1.07683997677947E-21 +72.0 1.06936148289763E-21 +72.5 1.0619861406559E-21 +73.0 1.05471183050003E-21 +73.5 1.04753649055071E-21 +74.0 1.04045811465512E-21 +74.5 1.03347475051685E-21 +75.0 1.02658449790078E-21 +75.5 1.0197855069091E-21 +76.0 1.01307597632555E-21 +76.5 1.00645415202448E-21 +77.0 9.99918325441935E-22 +77.5 9.93466832105953E-22 +78.0 9.87098050223329E-22 +78.5 9.8081039932043E-22 +79.0 9.74602338935618E-22 +79.5 9.68472367361003E-22 +80.0 9.62419020431394E-22 +80.5 9.56440870358376E-22 +81.0 9.50536524607566E-22 +81.5 9.44704624817207E-22 +82.0 9.38943845756314E-22 +82.5 9.33252894320715E-22 +83.0 9.27630508565376E-22 +83.5 9.22075456771488E-22 +84.0 9.16586536546883E-22 +84.5 9.11162573958379E-22 +85.0 9.0580242269475E-22 +85.5 9.00504963259068E-22 +86.0 8.95269102189219E-22 +86.5 8.90093771305448E-22 +87.0 8.84977926983857E-22 +87.5 8.79920549454808E-22 +88.0 8.74920642125247E-22 +88.5 8.69977230923997E-22 +89.0 8.65089363669119E-22 +89.5 8.60256109456484E-22 +90.0 8.55476558068722E-22 +90.5 8.50749819403762E-22 +91.0 8.46075022922218E-22 +91.5 8.41451317112887E-22 +92.0 8.36877868975678E-22 +92.5 8.32353863521313E-22 +93.0 8.27878503287165E-22 +93.5 8.23451007868634E-22 +94.0 8.19070613465468E-22 +94.5 8.14736572442504E-22 +95.0 8.10448152904265E-22 +95.5 8.06204638282927E-22 +96.0 8.02005326939165E-22 +96.5 7.978495317754E-22 +97.0 7.93736579861012E-22 +97.5 7.89665812069088E-22 +98.0 7.85636582724286E-22 +98.5 7.81648259261419E-22 +99.0 7.77700221894398E-22 +99.5 7.73791863295145E-22 +100.0 7.69922588282143E-22 +100.5 7.66091813518285E-22 +101.0 7.62298967217692E-22 +101.5 7.58543488861201E-22 +102.0 7.54824828920225E-22 +102.5 7.51142448588681E-22 +103.0 7.47495819522743E-22 +103.5 7.43884423588128E-22 +104.0 7.4030775261467E-22 +104.5 7.36765308157954E-22 +105.0 7.33256601267738E-22 diff --git a/src/modules/moduleCollisions.f90 b/src/modules/moduleCollisions.f90 index a53c7c3..4ade202 100644 --- a/src/modules/moduleCollisions.f90 +++ b/src/modules/moduleCollisions.f90 @@ -46,13 +46,20 @@ MODULE moduleCollisions 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 - REAL(8):: w_i = (1.D0+DSQRT(3.D0))/2.D0 - REAL(8):: w_j = (DSQRT(3.D0)-1.D0)/2.D0 CONTAINS PROCEDURE, PASS:: collide => collideBinaryIonization END TYPE collisionBinaryIonization + TYPE, EXTENDS(collisionBinary):: collisionBinaryRecombination + REAL(8):: eBinding !binding energy of free electron in recombining ion + REAL(8):: deltaV !Change in velocity due to energy exchange + CLASS(speciesCharged), POINTER:: electron !Pointer to species considerer as electrons + CONTAINS + PROCEDURE, PASS:: collide => collideBinaryRecombination + + END TYPE collisionBinaryRecombination + !Resonant charge-exchange TYPE, EXTENDS(collisionBinary):: collisionBinaryChargeExchange CONTAINS @@ -313,9 +320,118 @@ MODULE moduleCollisions END IF - END SUBROUTINE collideBinaryIonization + !ELECTRON ION RESONANT RECOMBINATION + !Inits electron ion recombination + SUBROUTINE initBinaryRecombination(collision, crossSectionFilename, energyBinding, mass_i, mass_j, electron) + USE moduleTable + USE moduleRefParam + USE moduleConstParam + USE moduleSpecies + USE moduleErrors + IMPLICIT NONE + + CLASS(collisionBinary), INTENT(out), ALLOCATABLE:: collision + CHARACTER(:), ALLOCATABLE, INTENT(in):: crossSectionFilename + REAL(8), INTENT(in):: energyBinding + REAL(8), INTENT(in):: mass_i, mass_j + CHARACTER(:), ALLOCATABLE, INTENT(in):: electron + INTEGER:: electronIndex + + ALLOCATE(collisionBinaryRecombination:: collision) + + !Reads data from file + CALL collision%crossSec%init(crossSectionFilename) + + !Convert to no-dimensional units + CALL collision%crossSec%convert(eV2J/(m_ref*v_ref**2), 1.D0/L_ref**2) + + !Calculates reduced mass + collision%rMass = (mass_i*mass_j)/(mass_i+mass_j) + + !Specific parameters for ionization collision + SELECT TYPE(collision) + TYPE IS(collisionBinaryRecombination) + !Assign the energy threshold + !Input energy is in eV. Convert to J with ev2J and then to + !non-dimensional units. + collision%eBinding = energyBinding*eV2J/(m_ref*v_ref**2) + electronIndex = speciesName2Index(electron) + SELECT TYPE(sp => species(electronIndex)%obj) + TYPE IS(speciesCharged) + collision%electron => sp + + CLASS DEFAULT + CALL criticalError("Species " // sp%name // " chosen for ionization is not a charged species", 'initBinaryIonization') + + END SELECT + + END SELECT + + END SUBROUTINE initBinaryRecombination + + !Binary electron impact ionization process + SUBROUTINE collideBinaryRecombination(self, sigmaVrelMax, sigmaVrelMaxNew, & + part_i, part_j) + USE moduleSpecies + USE moduleErrors + USE moduleList + USE moduleRandom + USE OMP_LIB + IMPLICIT NONE + + CLASS(collisionBinaryRecombination), INTENT(in):: self + REAL(8), INTENT(in):: sigmaVrelMax + REAL(8), INTENT(inout):: sigmaVrelMaxNew + TYPE(particle), INTENT(inout), TARGET:: part_i, part_j + TYPE(particle), POINTER:: electron, ion + REAL(8):: vRel, eRel + REAL(8):: sigmaVrel + REAL(8), DIMENSION(1:3):: vp_i + + !eRel (in units of [m][L]^2[t]^-2 + vRel = SUM(DABS(part_i%v-part_j%v)) !TODO make function of norm1 + eRel = self%rMass*vRel**2 + !Relative energy must be higher than threshold + sigmaVrel = self%crossSec%get(eRel)*vRel + sigmaVrelMaxNew = sigmaVrelMaxNew + sigmaVrel + IF (sigmaVrelMaxNew/sigmaVrelMax > random()) THEN + !Find which particle is the ionizing electron + IF (part_i%sp == self%electron%sp) THEN + electron => part_i + ion => part_j + + ELSEIF(part_j%sp == self%electron%sp) THEN + electron => part_j + ion => part_i + + ELSE + CALL criticalError("No matching between input particles and ionizing species", 'collideBinaryIonization') + + END IF + + !Excess energy + !TODO: This energy should be transformed into photons + vp_i = ion%v* (1.D0 - (vRel + self%deltaV)/NORM2(ion%v)) + + !Remove electron from simulation + electron%n_in = .FALSE. + + !Neutralize ion particle + SELECT TYPE(sp => species(ion%sp)%obj) + TYPE IS(speciesCharged) + CALL sp%neutralize(ion) + + CLASS DEFAULT + CALL criticalError(sp%name // " is not a charge", 'collideBinaryRecombination') + + END SELECT + + END IF + + END SUBROUTINE collideBinaryRecombination + !RESONANT CHARGE EXCHANGE !Inits resonant charge exchange SUBROUTINE initBinaryChargeExchange(collision, crossSectionFilename, mass_i, mass_j) diff --git a/src/modules/moduleInput.f90 b/src/modules/moduleInput.f90 index 2243ad5..9a454fc 100644 --- a/src/modules/moduleInput.f90 +++ b/src/modules/moduleInput.f90 @@ -513,7 +513,7 @@ MODULE moduleInput INTEGER:: nInteractions, nCollisions INTEGER:: i, k, ij INTEGER:: pt_i, pt_j - REAL(8):: energyThreshold + REAL(8):: energyThreshold, energyBinding CHARACTER(:), ALLOCATABLE:: electron CALL initInteractionMatrix(interactionMatrix) @@ -569,6 +569,15 @@ MODULE moduleInput CALL initBinaryIonization(interactionMatrix(ij)%collisions(k)%obj, & crossSecFilePath, energyThreshold, species(pt_i)%obj%m, species(pt_j)%obj%m, electron) + CASE ('recombination') + !Electorn impact ionization + CALL config%get(object // '.energyBinding', energyBinding, found) + 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 initBinaryRecombination(interactionMatrix(ij)%collisions(k)%obj, & + crossSecFilePath, energyBinding, species(pt_i)%obj%m, species(pt_j)%obj%m, electron) + CASE DEFAULT CALL criticalError('Collision type' // cType // 'not defined yet', 'readInteractions')