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
|
|
@ -92,6 +92,7 @@ MODULE moduleMesh3DCart
|
|||
SUBROUTINE initNode3DCart(self, n, r)
|
||||
USE moduleSpecies
|
||||
USE moduleRefParam
|
||||
USE OMP_LIB
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshNode3DCart), INTENT(out):: self
|
||||
|
|
@ -108,6 +109,8 @@ MODULE moduleMesh3DCart
|
|||
!Allocates output:
|
||||
ALLOCATE(self%output(1:nSpecies))
|
||||
|
||||
CALL OMP_INIT_LOCK(self%lock)
|
||||
|
||||
END SUBROUTINE initNode3DCart
|
||||
|
||||
!Get coordinates from node
|
||||
|
|
@ -481,36 +484,47 @@ MODULE moduleMesh3DCart
|
|||
SUBROUTINE scatterTetra(self, part)
|
||||
USE moduleMath
|
||||
USE moduleSpecies
|
||||
USE OMP_LIB
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshVol3DCartTetra), INTENT(in):: self
|
||||
CLASS(particle), INTENT(in):: part
|
||||
TYPE(outputNode), POINTER:: vertex
|
||||
REAL(8):: w_p(1:4)
|
||||
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(2)
|
||||
node%output(sp)%mom(:) = node%output(sp)%mom(:) + part%weight*w_p(2)*part%v(:)
|
||||
node%output(sp)%tensorS(:,:) = node%output(sp)%tensorS(:,:) + part%weight*w_p(2)*tensorS
|
||||
CALL OMP_UNSET_LOCK(node%lock)
|
||||
|
||||
vertex => self%n3%output(part%species%n)
|
||||
vertex%den = vertex%den + part%weight*w_p(3)
|
||||
vertex%mom(:) = vertex%mom(:) + part%weight*w_p(3)*part%v(:)
|
||||
vertex%tensorS(:,:) = vertex%tensorS(:,:) + part%weight*w_p(3)*tensorS
|
||||
node => self%n3
|
||||
CALL OMP_SET_LOCK(node%lock)
|
||||
node%output(sp)%den = node%output(sp)%den + part%weight*w_p(3)
|
||||
node%output(sp)%mom(:) = node%output(sp)%mom(:) + part%weight*w_p(3)*part%v(:)
|
||||
node%output(sp)%tensorS(:,:) = node%output(sp)%tensorS(:,:) + part%weight*w_p(3)*tensorS
|
||||
CALL OMP_UNSET_LOCK(node%lock)
|
||||
|
||||
vertex => self%n4%output(part%species%n)
|
||||
vertex%den = vertex%den + part%weight*w_p(4)
|
||||
vertex%mom(:) = vertex%mom(:) + part%weight*w_p(4)*part%v(:)
|
||||
vertex%tensorS(:,:) = vertex%tensorS(:,:) + part%weight*w_p(4)*tensorS
|
||||
node => self%n4
|
||||
CALL OMP_SET_LOCK(node%lock)
|
||||
node%output(sp)%den = node%output(sp)%den + part%weight*w_p(4)
|
||||
node%output(sp)%mom(:) = node%output(sp)%mom(:) + part%weight*w_p(4)*part%v(:)
|
||||
node%output(sp)%tensorS(:,:) = node%output(sp)%tensorS(:,:) + part%weight*w_p(4)*tensorS
|
||||
CALL OMP_UNSET_LOCK(node%lock)
|
||||
|
||||
END SUBROUTINE scatterTetra
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue