First attempt at Coulomb collisions

First attemp for Coulomb collisions based on the moments distribtuions.
Still the method is not done and far from being complete but input
options and basic math are implemented.
This commit is contained in:
Jorge Gonzalez 2023-02-24 21:46:01 +01:00
commit 601103105f
8 changed files with 295 additions and 26 deletions

View file

@ -144,6 +144,7 @@ MODULE moduleInput
EF_ref = qe*n_ref*L_ref/eps_0 !reference electric field
Volt_ref = EF_ref*L_ref !reference voltage
B_ref = m_ref / (ti_ref * qe) !reference magnetic field
e_ref = qe/(m_ref*v_ref**2) !reference charge
!If a reference cross section is given, it is used
CALL config%get(object // '.sigmaVrel', sigmavRel_ref, found)
@ -412,7 +413,7 @@ MODULE moduleInput
CALL partInitial%add(partNew)
!Assign particle to list in volume
IF (doMCC) THEN
IF (listInCells) THEN
cell => meshforMCC%cells(partNew%cellColl)%obj
CALL OMP_SET_LOCK(cell%lock)
CALL cell%listPart_in(sp)%add(partNew)
@ -613,6 +614,7 @@ MODULE moduleInput
USE moduleSpecies
USE moduleList
USE moduleCollisions
USE moduleCoulomb
USE moduleErrors
USE moduleMesh
USE moduleCaseParam
@ -640,10 +642,11 @@ MODULE moduleInput
!Firstly, check if the object 'interactions' exists
CALL config%info('interactions', found)
IF (found) THEN
!Checks if MC collisions have been defined
!Check if MC collisions have been defined
CALL config%info('interactions.collisions', found)
IF (found) THEN
!Reads collision time step
doMCCollisions = .TRUE.
!Read collision time step
CALL config%info('interactions.timeStep', found)
IF (found) THEN
CALL config%get('interactions.timeStep', tauColl, found)
@ -752,8 +755,35 @@ MODULE moduleInput
END IF
!Check if Coulomb scattering is defined
CALL config%info('interactions.Coulomb', found)
IF (found) THEN
CALL config%info('interactions.Coulomb', found, n_children = nPairs)
IF (nPairs > 0) THEN
nCoulombPairs = nPairs
doCoulombScattering = .TRUE.
ALLOCATE(coulombMatrix(1:nPairs))
DO i = 1, nPairs
WRITE(iString, '(I2)') i
object = 'interactions.Coulomb(' // TRIM(iString) // ')'
CALL config%get(object // '.species_i', species_i, found)
pt_i = speciesName2Index(species_i)
CALL config%get(object // '.species_j', species_j, found)
pt_j = speciesName2Index(species_j)
CALL coulombMatrix(i)%init(pt_i, pt_j)
END DO
END IF
END IF
END IF
listInCells = doMCCollisions .OR. doCoulombScattering
END SUBROUTINE readInteractions
!Reads boundary conditions for the mesh
@ -906,8 +936,6 @@ MODULE moduleInput
END IF
doMCC = ASSOCIATED(meshForMCC)
!Get the dimension of the geometry
CALL config%get(object // '.dimension', mesh%dimen, found)
IF (.NOT. found) THEN