Common scatter subroutine
All subroutines of scattering particle properties to the nodes of a volume have been converged into one in moduleMesh.
This commit is contained in:
parent
d613f80c0d
commit
35bd61fda9
9 changed files with 39 additions and 408 deletions
|
|
@ -164,7 +164,7 @@ MODULE moduleMesh
|
|||
PROCEDURE(getNodesVol_interface), DEFERRED, PASS:: getNodes
|
||||
PROCEDURE(randPosVol_interface), DEFERRED, PASS:: randPos
|
||||
PROCEDURE(fPsi_interface), DEFERRED, NOPASS:: fPsi
|
||||
PROCEDURE(scatter_interface), DEFERRED, PASS:: scatter
|
||||
PROCEDURE, PASS:: scatter
|
||||
PROCEDURE(gatherEF_interface), DEFERRED, PASS:: gatherEF
|
||||
PROCEDURE(elemK_interface), DEFERRED, PASS:: elemK
|
||||
PROCEDURE(elemF_interface), DEFERRED, PASS:: elemF
|
||||
|
|
@ -468,6 +468,40 @@ MODULE moduleMesh
|
|||
|
||||
END SUBROUTINE resetOutput
|
||||
|
||||
!Scatters particle properties into vol nodes
|
||||
SUBROUTINE scatter(self, part)
|
||||
USE moduleMath
|
||||
USE moduleSpecies
|
||||
USE OMP_LIB
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshVol), INTENT(inout):: self
|
||||
CLASS(particle), INTENT(in):: part
|
||||
REAL(8), ALLOCATABLE:: fPsi(:)
|
||||
INTEGER, ALLOCATABLE:: volNodes(:)
|
||||
REAL(8):: tensorS(1:3, 1:3)
|
||||
INTEGER:: sp
|
||||
INTEGER:: i, nNodes
|
||||
CLASS(meshNode), POINTER:: node
|
||||
|
||||
fPsi = self%fPsi(part%xi)
|
||||
tensorS = outerProduct(part%v, part%v)
|
||||
sp = part%species%n
|
||||
volNodes = self%getNodes()
|
||||
nNodes = SIZE(volNodes)
|
||||
|
||||
DO i = 1, nNodes
|
||||
node => mesh%nodes(volNodes(i))%obj
|
||||
CALL OMP_SET_LOCK(node%lock)
|
||||
node%output(sp)%den = node%output(sp)%den + part%weight*fPsi(i)
|
||||
node%output(sp)%mom(:) = node%output(sp)%mom(:) + part%weight*fPsi(i)*part%v(:)
|
||||
node%output(sp)%tensorS(:,:) = node%output(sp)%tensorS(:,:) + part%weight*fPsi(i)*tensorS
|
||||
CALL OMP_UNSET_LOCK(node%lock)
|
||||
|
||||
END DO
|
||||
|
||||
END SUBROUTINE scatter
|
||||
|
||||
!Find next cell for particle
|
||||
RECURSIVE SUBROUTINE findCell(self, part, oldCell)
|
||||
USE moduleSpecies
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue