First attempt at Coulomb collisions #46

Merged
JorgeGonz merged 21 commits from feature/CoulombLinear into development 2023-07-16 14:47:59 +02:00
2 changed files with 7 additions and 3 deletions
Showing only changes of commit f63e34e266 - Show all commits

Not fully conservative but works

The code is still not fully conservative in intra-species collisions
(small error) but at least now is working.

I have to test species with different weight.

I have to implement a fully conservation for intra-species.
Jorge Gonzalez 2023-07-11 18:55:20 +02:00

View file

@ -1069,6 +1069,7 @@ MODULE moduleMesh
deltaW_par_square = SQRT(AW * GlW * tauMin)*randomMaxwellian()
deltaW_per_square = SQRT(AW * HlW * tauMin)*randomMaxwellian()
!Random angle to distribute perpendicular change in velocity
theta_per = PI2*random()
!Change W
@ -1076,9 +1077,10 @@ MODULE moduleMesh
W(2) = deltaW_per_square * SIN(theta_per)
W(3) = normC + deltaW_par + deltaW_par_square
!Change particle velocity
!Update particle velocity and return to laboratory frame
partTemp%part%v = velocity + MATMUL(rotation, W)
!Move to the next particle in the list
partTemp => partTemp%next
END DO

View file

@ -59,8 +59,10 @@ MODULE moduleCoulomb
self%sp_i => species(i)%obj
self%sp_j => species(j)%obj
self%one_plus_massRatio_ij = 1.D0 + (self%sp_i%weight*self%sp_i%m)/(self%sp_j%weight*self%sp_j%m)
self%one_plus_massRatio_ij = 1.D0 + self%sp_i%m/self%sp_j%m
Z_i = 0.D0
Z_j = 0.D0
SELECT TYPE(sp => self%sp_i)
TYPE IS (speciesCharged)
Z_i = sp%q