Implementation of charge exchange and structure for ionization
processes.
This commit is contained in:
parent
baf25c1157
commit
35936ea918
9 changed files with 1604 additions and 29 deletions
302
data/collisions/CX_Ar-Ar+.dat
Normal file
302
data/collisions/CX_Ar-Ar+.dat
Normal file
|
|
@ -0,0 +1,302 @@
|
|||
#M. Lampe, et. al, Phys. Plasmas, 19(11):113703, 2012
|
||||
#Relative energy (eV) Cross Section (m^2)
|
||||
0.010 6.913E-19
|
||||
0.020 6.705E-19
|
||||
0.030 6.583E-19
|
||||
0.040 6.497E-19
|
||||
0.050 6.430E-19
|
||||
0.060 6.375E-19
|
||||
0.070 6.329E-19
|
||||
0.080 6.288E-19
|
||||
0.090 6.253E-19
|
||||
0.100 6.221E-19
|
||||
0.110 6.193E-19
|
||||
0.120 6.167E-19
|
||||
0.130 6.143E-19
|
||||
0.140 6.120E-19
|
||||
0.150 6.100E-19
|
||||
0.160 6.080E-19
|
||||
0.170 6.062E-19
|
||||
0.180 6.045E-19
|
||||
0.190 6.029E-19
|
||||
0.200 6.013E-19
|
||||
0.210 5.999E-19
|
||||
0.220 5.985E-19
|
||||
0.230 5.971E-19
|
||||
0.240 5.959E-19
|
||||
0.250 5.946E-19
|
||||
0.260 5.934E-19
|
||||
0.270 5.923E-19
|
||||
0.280 5.912E-19
|
||||
0.290 5.902E-19
|
||||
0.300 5.892E-19
|
||||
0.310 5.882E-19
|
||||
0.320 5.872E-19
|
||||
0.330 5.863E-19
|
||||
0.340 5.854E-19
|
||||
0.350 5.845E-19
|
||||
0.360 5.837E-19
|
||||
0.370 5.829E-19
|
||||
0.380 5.821E-19
|
||||
0.390 5.813E-19
|
||||
0.400 5.805E-19
|
||||
0.410 5.798E-19
|
||||
0.420 5.790E-19
|
||||
0.430 5.783E-19
|
||||
0.440 5.777E-19
|
||||
0.450 5.770E-19
|
||||
0.460 5.763E-19
|
||||
0.470 5.757E-19
|
||||
0.480 5.750E-19
|
||||
0.490 5.744E-19
|
||||
0.500 5.738E-19
|
||||
0.510 5.732E-19
|
||||
0.520 5.726E-19
|
||||
0.530 5.721E-19
|
||||
0.540 5.715E-19
|
||||
0.550 5.710E-19
|
||||
0.560 5.704E-19
|
||||
0.570 5.699E-19
|
||||
0.580 5.694E-19
|
||||
0.590 5.688E-19
|
||||
0.600 5.683E-19
|
||||
0.610 5.678E-19
|
||||
0.620 5.674E-19
|
||||
0.630 5.669E-19
|
||||
0.640 5.664E-19
|
||||
0.650 5.659E-19
|
||||
0.660 5.655E-19
|
||||
0.670 5.650E-19
|
||||
0.680 5.646E-19
|
||||
0.690 5.641E-19
|
||||
0.700 5.637E-19
|
||||
0.710 5.633E-19
|
||||
0.720 5.629E-19
|
||||
0.730 5.625E-19
|
||||
0.740 5.620E-19
|
||||
0.750 5.616E-19
|
||||
0.760 5.612E-19
|
||||
0.770 5.608E-19
|
||||
0.780 5.605E-19
|
||||
0.790 5.601E-19
|
||||
0.800 5.597E-19
|
||||
0.810 5.593E-19
|
||||
0.820 5.590E-19
|
||||
0.830 5.586E-19
|
||||
0.840 5.582E-19
|
||||
0.850 5.579E-19
|
||||
0.860 5.575E-19
|
||||
0.870 5.572E-19
|
||||
0.880 5.568E-19
|
||||
0.890 5.565E-19
|
||||
0.900 5.562E-19
|
||||
0.910 5.558E-19
|
||||
0.920 5.555E-19
|
||||
0.930 5.552E-19
|
||||
0.940 5.549E-19
|
||||
0.950 5.545E-19
|
||||
0.960 5.542E-19
|
||||
0.970 5.539E-19
|
||||
0.980 5.536E-19
|
||||
0.990 5.533E-19
|
||||
1.000 5.530E-19
|
||||
1.010 5.527E-19
|
||||
1.020 5.524E-19
|
||||
1.030 5.521E-19
|
||||
1.040 5.518E-19
|
||||
1.050 5.515E-19
|
||||
1.060 5.513E-19
|
||||
1.070 5.510E-19
|
||||
1.080 5.507E-19
|
||||
1.090 5.504E-19
|
||||
1.100 5.501E-19
|
||||
1.110 5.499E-19
|
||||
1.120 5.496E-19
|
||||
1.130 5.493E-19
|
||||
1.140 5.491E-19
|
||||
1.150 5.488E-19
|
||||
1.160 5.485E-19
|
||||
1.170 5.483E-19
|
||||
1.180 5.480E-19
|
||||
1.190 5.478E-19
|
||||
1.200 5.475E-19
|
||||
1.210 5.473E-19
|
||||
1.220 5.470E-19
|
||||
1.230 5.468E-19
|
||||
1.240 5.465E-19
|
||||
1.250 5.463E-19
|
||||
1.260 5.461E-19
|
||||
1.270 5.458E-19
|
||||
1.280 5.456E-19
|
||||
1.290 5.454E-19
|
||||
1.300 5.451E-19
|
||||
1.310 5.449E-19
|
||||
1.320 5.447E-19
|
||||
1.330 5.444E-19
|
||||
1.340 5.442E-19
|
||||
1.350 5.440E-19
|
||||
1.360 5.438E-19
|
||||
1.370 5.435E-19
|
||||
1.380 5.433E-19
|
||||
1.390 5.431E-19
|
||||
1.400 5.429E-19
|
||||
1.410 5.427E-19
|
||||
1.420 5.425E-19
|
||||
1.430 5.423E-19
|
||||
1.440 5.421E-19
|
||||
1.450 5.418E-19
|
||||
1.460 5.416E-19
|
||||
1.470 5.414E-19
|
||||
1.480 5.412E-19
|
||||
1.490 5.410E-19
|
||||
1.500 5.408E-19
|
||||
1.510 5.406E-19
|
||||
1.520 5.404E-19
|
||||
1.530 5.402E-19
|
||||
1.540 5.400E-19
|
||||
1.550 5.398E-19
|
||||
1.560 5.396E-19
|
||||
1.570 5.395E-19
|
||||
1.580 5.393E-19
|
||||
1.590 5.391E-19
|
||||
1.600 5.389E-19
|
||||
1.610 5.387E-19
|
||||
1.620 5.385E-19
|
||||
1.630 5.383E-19
|
||||
1.640 5.381E-19
|
||||
1.650 5.380E-19
|
||||
1.660 5.378E-19
|
||||
1.670 5.376E-19
|
||||
1.680 5.374E-19
|
||||
1.690 5.372E-19
|
||||
1.700 5.371E-19
|
||||
1.710 5.369E-19
|
||||
1.720 5.367E-19
|
||||
1.730 5.365E-19
|
||||
1.740 5.364E-19
|
||||
1.750 5.362E-19
|
||||
1.760 5.360E-19
|
||||
1.770 5.359E-19
|
||||
1.780 5.357E-19
|
||||
1.790 5.355E-19
|
||||
1.800 5.354E-19
|
||||
1.810 5.352E-19
|
||||
1.820 5.350E-19
|
||||
1.830 5.349E-19
|
||||
1.840 5.347E-19
|
||||
1.850 5.345E-19
|
||||
1.860 5.344E-19
|
||||
1.870 5.342E-19
|
||||
1.880 5.340E-19
|
||||
1.890 5.339E-19
|
||||
1.900 5.337E-19
|
||||
1.910 5.336E-19
|
||||
1.920 5.334E-19
|
||||
1.930 5.333E-19
|
||||
1.940 5.331E-19
|
||||
1.950 5.329E-19
|
||||
1.960 5.328E-19
|
||||
1.970 5.326E-19
|
||||
1.980 5.325E-19
|
||||
1.990 5.323E-19
|
||||
2.000 5.322E-19
|
||||
2.010 5.320E-19
|
||||
2.020 5.319E-19
|
||||
2.030 5.317E-19
|
||||
2.040 5.316E-19
|
||||
2.050 5.314E-19
|
||||
2.060 5.313E-19
|
||||
2.070 5.312E-19
|
||||
2.080 5.310E-19
|
||||
2.090 5.309E-19
|
||||
2.100 5.307E-19
|
||||
2.110 5.306E-19
|
||||
2.120 5.304E-19
|
||||
2.130 5.303E-19
|
||||
2.140 5.302E-19
|
||||
2.150 5.300E-19
|
||||
2.160 5.299E-19
|
||||
2.170 5.297E-19
|
||||
2.180 5.296E-19
|
||||
2.190 5.295E-19
|
||||
2.200 5.293E-19
|
||||
2.210 5.292E-19
|
||||
2.220 5.291E-19
|
||||
2.230 5.289E-19
|
||||
2.240 5.288E-19
|
||||
2.250 5.286E-19
|
||||
2.260 5.285E-19
|
||||
2.270 5.284E-19
|
||||
2.280 5.283E-19
|
||||
2.290 5.281E-19
|
||||
2.300 5.280E-19
|
||||
2.310 5.279E-19
|
||||
2.320 5.277E-19
|
||||
2.330 5.276E-19
|
||||
2.340 5.275E-19
|
||||
2.350 5.273E-19
|
||||
2.360 5.272E-19
|
||||
2.370 5.271E-19
|
||||
2.380 5.270E-19
|
||||
2.390 5.268E-19
|
||||
2.400 5.267E-19
|
||||
2.410 5.266E-19
|
||||
2.420 5.265E-19
|
||||
2.430 5.263E-19
|
||||
2.440 5.262E-19
|
||||
2.450 5.261E-19
|
||||
2.460 5.260E-19
|
||||
2.470 5.258E-19
|
||||
2.480 5.257E-19
|
||||
2.490 5.256E-19
|
||||
2.500 5.255E-19
|
||||
2.510 5.254E-19
|
||||
2.520 5.252E-19
|
||||
2.530 5.251E-19
|
||||
2.540 5.250E-19
|
||||
2.550 5.249E-19
|
||||
2.560 5.248E-19
|
||||
2.570 5.247E-19
|
||||
2.580 5.245E-19
|
||||
2.590 5.244E-19
|
||||
2.600 5.243E-19
|
||||
2.610 5.242E-19
|
||||
2.620 5.241E-19
|
||||
2.630 5.240E-19
|
||||
2.640 5.238E-19
|
||||
2.650 5.237E-19
|
||||
2.660 5.236E-19
|
||||
2.670 5.235E-19
|
||||
2.680 5.234E-19
|
||||
2.690 5.233E-19
|
||||
2.700 5.232E-19
|
||||
2.710 5.231E-19
|
||||
2.720 5.230E-19
|
||||
2.730 5.228E-19
|
||||
2.740 5.227E-19
|
||||
2.750 5.226E-19
|
||||
2.760 5.225E-19
|
||||
2.770 5.224E-19
|
||||
2.780 5.223E-19
|
||||
2.790 5.222E-19
|
||||
2.800 5.221E-19
|
||||
2.810 5.220E-19
|
||||
2.820 5.219E-19
|
||||
2.830 5.218E-19
|
||||
2.840 5.217E-19
|
||||
2.850 5.216E-19
|
||||
2.860 5.214E-19
|
||||
2.870 5.213E-19
|
||||
2.880 5.212E-19
|
||||
2.890 5.211E-19
|
||||
2.900 5.210E-19
|
||||
2.910 5.209E-19
|
||||
2.920 5.208E-19
|
||||
2.930 5.207E-19
|
||||
2.940 5.206E-19
|
||||
2.950 5.205E-19
|
||||
2.960 5.204E-19
|
||||
2.970 5.203E-19
|
||||
2.980 5.202E-19
|
||||
2.990 5.201E-19
|
||||
3.000 5.200E-19
|
||||
1010
runs/Argon_Expansion/mesh.msh
Normal file
1010
runs/Argon_Expansion/mesh.msh
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -49,7 +49,10 @@
|
|||
"interactions": {
|
||||
"folderCollisions": "./data/collisions/",
|
||||
"collisions": [
|
||||
{"species_i": "Argon", "species_j": "Argon", "crossSections": ["Ar-Ar_Elastic.dat"]}
|
||||
{"species_i": "Argon", "species_j": "Argon",
|
||||
"cTypes": [
|
||||
{"type": "elastic", "crossSection": "EL_Ar-Ar.dat"}
|
||||
]}
|
||||
]
|
||||
},
|
||||
"parallel": {
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ MODULE moduleMesh
|
|||
!Volume index
|
||||
INTEGER:: n = 0
|
||||
!Maximum collision rate
|
||||
REAL(8):: sigmaVrelMax = 1.D-15
|
||||
REAL(8):: sigmaVrelMax = 1.D-17
|
||||
!Volume
|
||||
REAL(8):: volume = 0.D0
|
||||
!List of particles inside the volume
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
MODULE moduleCollisions
|
||||
USE moduleTable
|
||||
|
||||
!Abstract type for collision between two particles
|
||||
TYPE, ABSTRACT:: collisionBinary
|
||||
REAL(8):: rMass !reduced mass
|
||||
TYPE(table1D):: crossSec !cross section of collision
|
||||
CONTAINS
|
||||
PROCEDURE(initBinary_interface), PASS, DEFERRED:: init
|
||||
PROCEDURE(collideBinary_interface), PASS, DEFERRED:: collide
|
||||
|
||||
END TYPE collisionBinary
|
||||
|
|
@ -38,16 +38,31 @@ MODULE moduleCollisions
|
|||
|
||||
END TYPE collisionCont
|
||||
|
||||
!Binary elastic interaction
|
||||
TYPE, EXTENDS(collisionBinary):: collisionBinaryElastic
|
||||
!Weight distribution for Maxwellian function
|
||||
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:: init => initBinaryElastic
|
||||
PROCEDURE, PASS:: collide => collideBinaryElastic
|
||||
|
||||
END TYPE collisionBinaryElastic
|
||||
|
||||
!Ionization binary interaction
|
||||
TYPE, EXTENDS(collisionBinary):: collisionBinaryIonization
|
||||
REAL(8):: eThreshold !Minimum energy (non-dimensional units) required for ionization
|
||||
CONTAINS
|
||||
PROCEDURE, PASS:: collide => collideBinaryIonization
|
||||
|
||||
END TYPE collisionBinaryIonization
|
||||
|
||||
!Resonant charge-exchange
|
||||
TYPE, EXTENDS(collisionBinary):: collisionBinaryChargeExchange
|
||||
CONTAINS
|
||||
PROCEDURE, PASS:: collide => collideBinaryChargeExchange
|
||||
|
||||
END TYPE collisionBinaryChargeExchange
|
||||
|
||||
!Type for interaction matrix
|
||||
TYPE:: interactionsBinary
|
||||
INTEGER:: amount
|
||||
|
|
@ -58,11 +73,12 @@ MODULE moduleCollisions
|
|||
END TYPE interactionsBinary
|
||||
|
||||
!Collision 'Matrix'. A symmetric 2D matrix put into a 1D array to save memory
|
||||
TYPE(interactionsBinary), ALLOCATABLE:: interactionMatrix(:)
|
||||
TYPE(interactionsBinary), ALLOCATABLE, TARGET:: interactionMatrix(:)
|
||||
!Folder for collision cross section tables
|
||||
CHARACTER(:), ALLOCATABLE:: pathCollisions
|
||||
|
||||
CONTAINS
|
||||
!Inits the interaction matrix
|
||||
SUBROUTINE initInteractionMatrix(interactionMatrix)
|
||||
USE moduleSpecies
|
||||
IMPLICIT NONE
|
||||
|
|
@ -75,6 +91,7 @@ MODULE moduleCollisions
|
|||
|
||||
END SUBROUTINE initInteractionMatrix
|
||||
|
||||
!Gets the interaction index from the collision matrix from index i,j
|
||||
FUNCTION interactionIndex(i,j) RESULT(k)
|
||||
|
||||
INTEGER:: i, j
|
||||
|
|
@ -87,50 +104,49 @@ MODULE moduleCollisions
|
|||
|
||||
END FUNCTION interactionIndex
|
||||
|
||||
!Inits the binary interaction
|
||||
SUBROUTINE initInteractionBinary(self, amount)
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(interactionsBinary), INTENT(inout):: self
|
||||
INTEGER, INTENT(in):: amount
|
||||
INTEGER:: k
|
||||
|
||||
self%amount = amount
|
||||
|
||||
ALLOCATE(self%collisions(1:self%amount))
|
||||
DO k= 1, self%amount
|
||||
!TODO: make type dependent
|
||||
ALLOCATE(collisionBinaryElastic:: self%collisions(k)%obj)
|
||||
|
||||
END DO
|
||||
|
||||
END SUBROUTINE initInteractionBinary
|
||||
|
||||
SUBROUTINE initBinaryElastic(self, crossSectionFilename, mass_i, mass_j)
|
||||
!ELASTIC COLLISIONS
|
||||
!Inits binary elastic collision
|
||||
SUBROUTINE initBinaryElastic(collision, crossSectionFilename, mass_i, mass_j)
|
||||
USE moduleTable
|
||||
USE moduleRefParam
|
||||
USE moduleConstParam
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(collisionBinaryElastic), INTENT(inout):: self
|
||||
CLASS(collisionBinary), INTENT(out), ALLOCATABLE:: collision
|
||||
CHARACTER(:), ALLOCATABLE, INTENT(in):: crossSectionFilename
|
||||
REAL(8), INTENT(in):: mass_i, mass_j
|
||||
|
||||
ALLOCATE(collisionBinaryElastic:: collision)
|
||||
|
||||
!Reads data from file
|
||||
CALL self%crossSec%init(crossSectionFilename)
|
||||
CALL collision%crossSec%init(crossSectionFilename)
|
||||
|
||||
!Convert to no-dimensional units
|
||||
CALL self%crossSec%convert(eV2J/(m_ref*v_ref**2), 1.D0/L_ref**2)
|
||||
CALL collision%crossSec%convert(eV2J/(m_ref*v_ref**2), 1.D0/L_ref**2)
|
||||
|
||||
!Calculates reduced mass
|
||||
self%rMass = (mass_i*mass_j)/(mass_i+mass_j)
|
||||
collision%rMass = (mass_i*mass_j)/(mass_i+mass_j)
|
||||
|
||||
END SUBROUTINE
|
||||
END SUBROUTINE initBinaryElastic
|
||||
|
||||
!Binary elastic process
|
||||
SUBROUTINE collideBinaryElastic(self, sigmaVrelMax, sigmaVrelMaxNew, &
|
||||
part_i, part_j)
|
||||
USE moduleConstParam
|
||||
USE moduleSpecies
|
||||
USE moduleTable
|
||||
USE moduleConstParam
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(collisionBinaryElastic), INTENT(in):: self
|
||||
|
|
@ -145,7 +161,7 @@ MODULE moduleCollisions
|
|||
REAL(8):: alpha !random angle of scattering
|
||||
REAL(8):: rnd
|
||||
|
||||
!eRel (in units of [m][L]^2[s]^-2
|
||||
!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
|
||||
sigmaVrel = self%crossSec%get(eRel)*vRel
|
||||
|
|
@ -169,7 +185,124 @@ MODULE moduleCollisions
|
|||
|
||||
END IF
|
||||
|
||||
END SUBROUTINE collideBinaryElastic
|
||||
|
||||
END SUBROUTINE
|
||||
!ELECTRON IMPACT IONIZATION
|
||||
!Inits electron impact ionization
|
||||
SUBROUTINE initBinaryIonization(collision, crossSectionFilename, energyThreshold, mass_i, mass_j)
|
||||
USE moduleTable
|
||||
USE moduleRefParam
|
||||
USE moduleConstParam
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(collisionBinary), INTENT(out), ALLOCATABLE:: collision
|
||||
CHARACTER(:), ALLOCATABLE, INTENT(in):: crossSectionFilename
|
||||
REAL(8), INTENT(in):: energyThreshold
|
||||
REAL(8), INTENT(in):: mass_i, mass_j
|
||||
|
||||
ALLOCATE(collisionBinaryIonization:: 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)
|
||||
|
||||
SELECT TYPE(collision)
|
||||
TYPE IS(collisionBinaryIonization)
|
||||
!Assign the energy threshold
|
||||
collision%eThreshold = energyThreshold/(m_ref*v_ref**2)
|
||||
|
||||
END SELECT
|
||||
|
||||
END SUBROUTINE initBinaryIonization
|
||||
|
||||
!Binary electron impact ionization process
|
||||
SUBROUTINE collideBinaryIonization(self, sigmaVrelMax, sigmaVrelMaxNew, &
|
||||
part_i, part_j)
|
||||
USE moduleSpecies
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(collisionBinaryIonization), INTENT(in):: self
|
||||
REAL(8), INTENT(in):: sigmaVrelMax
|
||||
REAL(8), INTENT(inout):: sigmaVrelMaxNew
|
||||
TYPE(particle), INTENT(inout):: part_i, part_j
|
||||
|
||||
END SUBROUTINE collideBinaryIonization
|
||||
|
||||
!RESONANT CHARGE EXCHANGE
|
||||
!Inits resonant charge exchange
|
||||
SUBROUTINE initBinaryChargeExchange(collision, crossSectionFilename, mass_i, mass_j)
|
||||
USE moduleTable
|
||||
USE moduleRefParam
|
||||
USE moduleConstParam
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(collisionBinary), INTENT(out), ALLOCATABLE:: collision
|
||||
CHARACTER(:), ALLOCATABLE, INTENT(in):: crossSectionFilename
|
||||
REAL(8), INTENT(in):: mass_i, mass_j
|
||||
|
||||
ALLOCATE(collisionBinaryChargeExchange:: 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)
|
||||
|
||||
END SUBROUTINE initBinaryChargeExchange
|
||||
|
||||
SUBROUTINE collideBinaryChargeExchange(self, sigmaVrelMax, sigmaVrelMaxNew, &
|
||||
part_i, part_j)
|
||||
USE moduleSpecies
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(collisionBinaryChargeExchange), INTENT(in):: self
|
||||
REAL(8), INTENT(in):: sigmaVrelMax
|
||||
REAL(8), INTENT(inout):: sigmaVrelMaxNew
|
||||
TYPE(particle), INTENT(inout):: part_i, part_j
|
||||
REAL(8):: sigmaVrel
|
||||
REAL(8):: vRel !relative velocity
|
||||
REAL(8):: eRel !relative energy
|
||||
REAL(8):: rnd
|
||||
|
||||
!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
|
||||
sigmaVrel = self%crossSec%get(eRel)*vRel
|
||||
sigmaVrelMaxNew = sigmaVrelMaxNew + sigmaVrel
|
||||
CALL RANDOM_NUMBER(rnd)
|
||||
IF (sigmaVrelMaxNew/sigmaVrelMax > rnd) THEN
|
||||
SELECT TYPE(sp => species(part_i%sp)%obj)
|
||||
TYPE IS (speciesNeutral)
|
||||
!Species i is neutral, ionize particle i
|
||||
CALL sp%ionize(part_i)
|
||||
|
||||
TYPE IS (speciesCharged)
|
||||
!Species i is charged, neutralize particle i
|
||||
CALL sp%neutralize(part_i)
|
||||
|
||||
END SELECT
|
||||
|
||||
SELECT TYPE(sp => species(part_j%sp)%obj)
|
||||
TYPE IS (speciesNeutral)
|
||||
!Species j is neutral, ionize particle j
|
||||
CALL sp%ionize(part_j)
|
||||
|
||||
TYPE IS (speciesCharged)
|
||||
!Species j is charged, neutralize particle j
|
||||
CALL sp%neutralize(part_j)
|
||||
|
||||
END SELECT
|
||||
|
||||
END IF
|
||||
|
||||
END SUBROUTINE collideBinaryChargeExchange
|
||||
|
||||
END MODULE moduleCollisions
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ MODULE moduleInput
|
|||
|
||||
!Derived parameters
|
||||
v_ref = DSQRT(kb*T_ref/m_ref) !reference velocity
|
||||
!TODO: Make this solver dependent
|
||||
IF (found_r) THEN
|
||||
sigma_ref = PI*(r_ref+r_ref)**2 !reference cross section
|
||||
L_ref = 1.D0/(sigma_ref*n_ref) !mean free path
|
||||
|
|
@ -238,6 +237,8 @@ MODULE moduleInput
|
|||
REAL(8):: mass, charge
|
||||
LOGICAL:: found
|
||||
INTEGER:: i
|
||||
CHARACTER(:), ALLOCATABLE:: linkName
|
||||
INTEGER:: linkID
|
||||
|
||||
!Gets the number of species
|
||||
CALL config%info('species', found, n_children = nSpecies)
|
||||
|
|
@ -276,6 +277,39 @@ MODULE moduleInput
|
|||
|
||||
END DO
|
||||
|
||||
!Reads relations between species
|
||||
DO i = 1, nSpecies
|
||||
SELECT TYPE(sp => species(i)%obj)
|
||||
TYPE IS (speciesNeutral)
|
||||
!Gets species linked ion
|
||||
CALL config%get(object // '.ion', linkName, found)
|
||||
IF (found) THEN
|
||||
linkID = speciesName2Index(linkName)
|
||||
sp%ion => species(linkID)%obj
|
||||
|
||||
END IF
|
||||
|
||||
TYPE IS (speciesCharged)
|
||||
!Gets species linked neutral
|
||||
CALL config%get(object // '.neutral', linkName)
|
||||
IF (found) THEN
|
||||
linkID = speciesName2Index(linkName)
|
||||
sp%neutral => species(linkID)%obj
|
||||
|
||||
END IF
|
||||
|
||||
!Gets species linked ion
|
||||
CALL config%get(object // '.ion', linkName, found)
|
||||
IF (found) THEN
|
||||
linkID = speciesName2Index(linkName)
|
||||
sp%ion => species(linkID)%obj
|
||||
|
||||
END IF
|
||||
|
||||
END SELECT
|
||||
|
||||
END DO
|
||||
|
||||
!Set number of particles to 0 for init state
|
||||
!TODO: In a future, this should include the particles from init states
|
||||
nPartOld = 0
|
||||
|
|
@ -289,6 +323,7 @@ MODULE moduleInput
|
|||
SUBROUTINE readInteractions(config)
|
||||
USE moduleSpecies
|
||||
USE moduleCollisions
|
||||
USE moduleErrors
|
||||
USE json_module
|
||||
IMPLICIT NONE
|
||||
|
||||
|
|
@ -298,10 +333,12 @@ MODULE moduleInput
|
|||
CHARACTER(:), ALLOCATABLE:: species_i, species_j
|
||||
CHARACTER(:), ALLOCATABLE:: crossSecFile
|
||||
CHARACTER(:), ALLOCATABLE:: crossSecFilePath
|
||||
CHARACTER(:), ALLOCATABLE:: cType
|
||||
LOGICAL:: found
|
||||
INTEGER:: nInteractions, nCollisions
|
||||
INTEGER:: i, k, ij
|
||||
INTEGER:: pt_i, pt_j
|
||||
REAL(8):: energyThreshold
|
||||
|
||||
CALL initInteractionMatrix(interactionMatrix)
|
||||
|
||||
|
|
@ -315,15 +352,43 @@ MODULE moduleInput
|
|||
pt_i = speciesName2Index(species_i)
|
||||
CALL config%get(object // '.species_j', species_j, found)
|
||||
pt_j = speciesName2Index(species_j)
|
||||
CALL config%info(object // '.crossSections', found, n_children = nCollisions)
|
||||
CALL config%info(object // '.cTypes', found, n_children = nCollisions)
|
||||
ij = interactionIndex(pt_i,pt_j)
|
||||
!Allocates the required number of collisions per each pair of species ij
|
||||
CALL interactionMatrix(ij)%init(nCollisions)
|
||||
|
||||
DO k = 1, nCollisions
|
||||
WRITE (kString, '(I2)') k
|
||||
CALL config%get(object // '.crossSections(' // TRIM(kString)// ')', crossSecFile, found)
|
||||
object = 'interactions.collisions(' // TRIM(iString) // ').cTypes(' // TRIM(kString) // ')'
|
||||
!Reads the cross section file
|
||||
CALL config%get(object // '.crossSection', crossSecFile, found)
|
||||
crossSecFilePath = pathCollisions // crossSecFile
|
||||
CALL interactionMatrix(ij)%collisions(k)%obj%init(crossSecFilePath, species(pt_i)%obj%m, species(pt_j)%obj%m)
|
||||
IF (.NOT. found) CALL criticalError('crossSection not found for ' // object, 'readInteractions')
|
||||
!Reads the type of collision
|
||||
CALL config%get(object // '.type', cType, found)
|
||||
!Initialize collision type and reads required additional data
|
||||
SELECT CASE(cType)
|
||||
CASE ('elastic')
|
||||
!Elastic collision
|
||||
CALL initBinaryElastic(interactionMatrix(ij)%collisions(k)%obj, &
|
||||
crossSecFilePath, species(pt_i)%obj%m, species(pt_j)%obj%m)
|
||||
|
||||
CASE ('chargeExchange')
|
||||
!Resonant charge exchange
|
||||
CALL initBinaryChargeExchange(interactionMatrix(ij)%collisions(k)%obj, &
|
||||
crossSecFilePath, species(pt_i)%obj%m, species(pt_j)%obj%m)
|
||||
|
||||
CASE ('ionization')
|
||||
!Electorn impact ionization
|
||||
CALL config%get(object // '.energyThreshold', found)
|
||||
IF (.NOT. found) CALL criticalError('energyThreshold not found for collision' // object, 'readInteractions')
|
||||
CALL initBinaryIonization(interactionMatrix(ij)%collisions(k)%obj, &
|
||||
crossSecFilePath, energyThreshold, species(pt_i)%obj%m, species(pt_j)%obj%m)
|
||||
|
||||
CASE DEFAULT
|
||||
CALL criticalError('Collision type' // cType // 'not defined yet', 'readInteractions')
|
||||
|
||||
END SELECT
|
||||
|
||||
END DO
|
||||
|
||||
|
|
|
|||
|
|
@ -11,11 +11,18 @@ MODULE moduleSpecies
|
|||
END TYPE speciesGeneric
|
||||
|
||||
TYPE, EXTENDS(speciesGeneric):: speciesNeutral
|
||||
CLASS(speciesGeneric), POINTER:: ion => NULL()
|
||||
CONTAINS
|
||||
PROCEDURE, PASS:: ionize => ionizeNeutral
|
||||
|
||||
END TYPE speciesNeutral
|
||||
|
||||
TYPE, EXTENDS(speciesGeneric):: speciesCharged
|
||||
REAL(8):: q=0.D0, qm=0.D0
|
||||
CLASS(speciesGeneric), POINTER:: ion => NULL(), neutral => NULL()
|
||||
CONTAINS
|
||||
PROCEDURE, PASS:: ionize => ionizeCharged
|
||||
PROCEDURE, PASS:: neutralize => neutralizeCharged
|
||||
|
||||
END TYPE speciesCharged
|
||||
|
||||
|
|
@ -25,7 +32,7 @@ MODULE moduleSpecies
|
|||
END TYPE
|
||||
|
||||
INTEGER:: nSpecies
|
||||
TYPE(speciesCont), ALLOCATABLE:: species(:)
|
||||
TYPE(speciesCont), ALLOCATABLE, TARGET:: species(:)
|
||||
|
||||
TYPE particle
|
||||
REAL(8):: r(1:3) !Position
|
||||
|
|
@ -68,4 +75,59 @@ MODULE moduleSpecies
|
|||
|
||||
END FUNCTION speciesName2Index
|
||||
|
||||
!Change particle type to corresponding ion (neutral species)
|
||||
SUBROUTINE ionizeNeutral(self, part)
|
||||
USE moduleErrors
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(speciesNeutral), INTENT(IN):: self
|
||||
TYPE(particle), INTENT(inout):: part
|
||||
|
||||
IF (ASSOCIATED(self%ion)) THEN
|
||||
part%sp = self%ion%sp
|
||||
|
||||
ELSE
|
||||
CALL criticalError('No ion defined for species' // self%name, 'ionizeNeutral')
|
||||
|
||||
END IF
|
||||
|
||||
END SUBROUTINE ionizeNeutral
|
||||
|
||||
!Change particle type to corresponding ion (charged species)
|
||||
SUBROUTINE ionizeCharged(self, part)
|
||||
USE moduleErrors
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(speciesCharged), INTENT(IN):: self
|
||||
TYPE(particle), INTENT(inout):: part
|
||||
|
||||
IF (ASSOCIATED(self%ion)) THEN
|
||||
part%sp = self%ion%sp
|
||||
|
||||
ELSE
|
||||
CALL criticalError('No ion defined for species' // self%name, 'ionizeCharged')
|
||||
|
||||
END IF
|
||||
|
||||
END SUBROUTINE ionizeCharged
|
||||
|
||||
!Change particle type to corresponding neutral
|
||||
SUBROUTINE neutralizeCharged(self, part)
|
||||
USE moduleErrors
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(speciesCharged), INTENT(in):: self
|
||||
TYPE(particle), INTENT(inout):: part
|
||||
|
||||
IF (ASSOCIATED(self%neutral)) THEN
|
||||
part%sp = self%neutral%sp
|
||||
|
||||
ELSE
|
||||
CALL criticalError('No neutral defined for species' // self%name, 'neutralizeCharged')
|
||||
|
||||
END IF
|
||||
|
||||
END SUBROUTINE neutralizeCharged
|
||||
|
||||
END MODULE moduleSpecies
|
||||
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ MODULE moduleTable
|
|||
amount = 0
|
||||
DO
|
||||
READ(id, '(A)', iostat = stat) dummy
|
||||
!Skip comment
|
||||
IF (INDEX(dummy,'#') /= 0) CYCLE
|
||||
!If EOF or error, exit file
|
||||
IF (stat /= 0) EXIT
|
||||
!Skip comment
|
||||
IF (INDEX(dummy,'#') /= 0) CYCLE
|
||||
!Add row
|
||||
amount = amount + 1
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ MODULE moduleTable
|
|||
|
||||
END DO
|
||||
|
||||
CLOSE(10)
|
||||
CLOSE(id)
|
||||
|
||||
self%xMin = self%x(1)
|
||||
self%xMax = self%x(amount)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue