Change in calculation of reduced mass and relative energy

Now reduced mass and relative energy are calculated on the fly per
collision.
This commit is contained in:
Jorge Gonzalez 2022-12-09 09:54:44 +01:00
commit ae8aa9075e
2 changed files with 6 additions and 8 deletions

View file

@ -660,6 +660,7 @@ MODULE moduleMesh
use moduleRefParam
USE moduleRandom
USE moduleOutput
USE moduleMath
IMPLICIT NONE
CLASS(meshGeneric), INTENT(inout), TARGET:: self
@ -673,7 +674,7 @@ MODULE moduleMesh
TYPE(pointerArray), ALLOCATABLE:: partTemp_i(:), partTemp_j(:)
TYPE(particle), POINTER:: part_i, part_j
INTEGER:: n, c
REAL(8):: vRel, eRel
REAL(8):: vRel, rMass, eRel
REAL(8):: sigmaVrelTotal
REAL(8), ALLOCATABLE:: sigmaVrel(:), probabilityColl(:)
REAL(8):: rnd !Random number for collision
@ -749,7 +750,8 @@ MODULE moduleMesh
!Obtain the cross sections for the different processes
!TODO: From here it might be a procedure in interactionMatrix
vRel = NORM2(part_i%v-part_j%v)
eRel = interactionMatrix(k)%rMass*vRel**2
rMass = reducedMass(part_i%weight*part_i%species%m, part_j%weight*part_j%species%m)
eRel = rMass*vRel**2
CALL interactionMatrix(k)%getSigmaVrel(vRel, eRel, sigmaVrelTotal, sigmaVrel)
!Update maximum sigma*v_rel