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:
parent
0ffdb8578a
commit
a681b9f533
18 changed files with 348 additions and 114 deletions
|
|
@ -91,6 +91,7 @@ MODULE moduleMesh1DCart
|
|||
SUBROUTINE initNode1DCart(self, n, r)
|
||||
USE moduleSpecies
|
||||
USE moduleRefParam
|
||||
USE OMP_LIB
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshNode1DCart), INTENT(out):: self
|
||||
|
|
@ -105,6 +106,8 @@ MODULE moduleMesh1DCart
|
|||
!Allocates output
|
||||
ALLOCATE(self%output(1:nSpecies))
|
||||
|
||||
CALL OMP_INIT_LOCK(self%lock)
|
||||
|
||||
END SUBROUTINE initNode1DCart
|
||||
|
||||
PURE FUNCTION getCoord1DCart(self) RESULT(r)
|
||||
|
|
@ -378,26 +381,33 @@ MODULE moduleMesh1DCart
|
|||
SUBROUTINE scatterSegm(self, part)
|
||||
USE moduleMath
|
||||
USE moduleSpecies
|
||||
USE OMP_LIB
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshVol1DCartSegm), INTENT(in):: self
|
||||
CLASS(particle), INTENT(in):: part
|
||||
TYPE(outputNode), POINTER:: vertex
|
||||
REAL(8):: w_p(1:2)
|
||||
REAL(8):: tensorS(1:3,1:3)
|
||||
CLASS(meshNode), POINTER:: node
|
||||
INTEGER:: sp
|
||||
|
||||
w_p = self%weight(part%xi)
|
||||
tensorS = outerProduct(part%v, part%v)
|
||||
|
||||
vertex => self%n1%output(part%species%n)
|
||||
vertex%den = vertex%den + part%weight*w_p(1)
|
||||
vertex%mom(:) = vertex%mom(:) + part%weight*w_p(1)*part%v(:)
|
||||
vertex%tensorS(:,:) = vertex%tensorS(:,:) + part%weight*w_p(1)*tensorS
|
||||
sp = part%species%n
|
||||
node => self%n1
|
||||
CALL OMP_SET_LOCK(node%lock)
|
||||
node%output(sp)%den = node%output(sp)%den + part%weight*w_p(1)
|
||||
node%output(sp)%mom(:) = node%output(sp)%mom(:) + part%weight*w_p(1)*part%v(:)
|
||||
node%output(sp)%tensorS(:,:) = node%output(sp)%tensorS(:,:) + part%weight*w_p(1)*tensorS
|
||||
CALL OMP_UNSET_LOCK(node%lock)
|
||||
|
||||
vertex => self%n2%output(part%species%n)
|
||||
vertex%den = vertex%den + part%weight*w_p(2)
|
||||
vertex%mom(:) = vertex%mom(:) + part%weight*w_p(2)*part%v(:)
|
||||
vertex%tensorS(:,:) = vertex%tensorS(:,:) + part%weight*w_p(2)*tensorS
|
||||
node => self%n2
|
||||
CALL OMP_SET_LOCK(node%lock)
|
||||
node%output(sp)%den = node%output(sp)%den + part%weight*w_p(1)
|
||||
node%output(sp)%mom(:) = node%output(sp)%mom(:) + part%weight*w_p(1)*part%v(:)
|
||||
node%output(sp)%tensorS(:,:) = node%output(sp)%tensorS(:,:) + part%weight*w_p(1)*tensorS
|
||||
CALL OMP_UNSET_LOCK(node%lock)
|
||||
|
||||
END SUBROUTINE scatterSegm
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue