Improve to collisions

Improvement into the collision model to better compute number of
particles collisions.
This commit is contained in:
Jorge Gonzalez 2022-04-23 18:57:27 +02:00
commit 78a97ed7a0
12 changed files with 227 additions and 219 deletions

View file

@ -133,16 +133,16 @@ MODULE moduleInput
IF (.NOT. found) CALL criticalError('Reference temperature not found','readReference')
!If a reference cross section is given, it is used
CALL config%get(object // '.crossSection', sigma_ref, found)
CALL config%get(object // '.sigmaVrel', sigmavRel_ref, found)
!If not, the reference radius is searched
IF (.NOT. found) THEN
CALL config%get(object // '.radius', r_ref, found)
IF (found) THEN
sigma_ref = PI*(r_ref+r_ref)**2 !reference cross section
sigmaVrel_ref = PI*(r_ref+r_ref)**2*v_ref !reference cross section times velocity
ELSE
sigma_ref = 0.D0 !Assume no collisions
sigmaVrel_ref = 0.D0 !Assume no collisions
END IF
@ -685,7 +685,7 @@ MODULE moduleInput
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)
CALL interactionMatrix(ij)%init(nCollisions, species(pt_i)%obj%m, species(pt_j)%obj%m)
DO k = 1, nCollisions
WRITE (kString, '(I2)') k
@ -700,13 +700,11 @@ MODULE moduleInput
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)
CALL initBinaryElastic(interactionMatrix(ij)%collisions(k)%obj, crossSecFilePath)
CASE ('chargeExchange')
!Resonant charge exchange
CALL initBinaryChargeExchange(interactionMatrix(ij)%collisions(k)%obj, &
crossSecFilePath, species(pt_i)%obj%m, species(pt_j)%obj%m)
CALL initBinaryChargeExchange(interactionMatrix(ij)%collisions(k)%obj, crossSecFilePath)
CASE ('ionization')
!Electorn impact ionization
@ -715,7 +713,7 @@ MODULE moduleInput
CALL config%get(object // '.electron', electron, found)
IF (.NOT. found) CALL criticalError('electron 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, electron)
crossSecFilePath, energyThreshold, electron)
CASE ('recombination')
!Electorn impact ionization
@ -724,7 +722,7 @@ MODULE moduleInput
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)
crossSecFilePath, energyBinding, electron)
CASE DEFAULT
CALL criticalError('Collision type' // cType // 'not defined yet', 'readInteractions')