0D Grid geometry

Implementation of the 0D grid to test collisional processes.

An OMP_LOCK was added to the nodes to properly write perform the
scattering (it is weird that multiple threads work in the same node at
the same time, but in 0D happens everytime).

Added a new case to test the 0D geometry.

User Manual updated with the new options.
This commit is contained in:
Jorge Gonzalez 2021-04-13 21:48:44 +02:00
commit a681b9f533
18 changed files with 348 additions and 114 deletions

View file

@ -33,6 +33,7 @@ MODULE moduleMesh0D
!Init node
SUBROUTINE initNode0D(self, n, r)
USE moduleSpecies
USE OMP_LIB
IMPLICIT NONE
CLASS(meshNode0D), INTENT(out):: self
@ -43,6 +44,8 @@ MODULE moduleMesh0D
ALLOCATE(self%output(1:nSpecies))
CALL OMP_INIT_LOCK(self%lock)
END SUBROUTINE initNode0D
!Get node coordinates
@ -113,19 +116,24 @@ MODULE moduleMesh0D
SUBROUTINE scatter0D(self, part)
USE moduleMath
USE moduleSpecies
USE OMP_LIB
IMPLICIT NONE
CLASS(meshVol0D), INTENT(in):: self
CLASS(particle), INTENT(in):: part
REAL(8):: tensorS(1:3,1:3)
TYPE(outputNode), POINTER:: vertex
CLASS(meshNode), POINTER:: node
INTEGER:: sp
tensorS = outerProduct(part%v, part%v)
vertex => self%n1%output(part%species%n)
vertex%den = vertex%den + part%weight
vertex%mom(:) = vertex%mom(:) + part%weight*part%v(:)
vertex%tensorS(:,:) = vertex%tensorS(:,:) + part%weight*tensorS
node => self%n1
sp = part%species%n
CALL OMP_SET_LOCK(node%lock)
node%output(sp)%den = node%output(sp)%den + part%weight
node%output(sp)%mom(:) = node%output(sp)%mom(:) + part%weight*part%v(:)
node%output(sp)%tensorS(:,:) = node%output(sp)%tensorS(:,:) + part%weight*tensorS
CALL OMP_UNSET_LOCK(node%lock)
END SUBROUTINE scatter0D