Adjust flux when no particlesPerEdge is used
This does not affects the cases of the IEPC, but I am also doing other stuff.
This commit is contained in:
parent
8e531ede08
commit
d1e73297eb
1 changed files with 8 additions and 4 deletions
|
|
@ -199,17 +199,21 @@ MODULE moduleInject
|
|||
|
||||
END DO
|
||||
|
||||
self%nParticles = SUM(self%particlesPerEdge)
|
||||
|
||||
ELSE
|
||||
! No particles assigned per edge, use the species weight
|
||||
self%weightPerEdge = self%species%weight
|
||||
DO et = 1, self%nEdges
|
||||
self%particlesPerEdge(et) = FLOOR(fluxPerStep*mesh%edges(self%edges(et))%obj%surface /self%species%weight)
|
||||
|
||||
self%particlesPerEdge(et) = max(1,FLOOR(fluxPerStep*mesh%edges(self%edges(et))%obj%surface / self%species%weight))
|
||||
END DO
|
||||
|
||||
END IF
|
||||
self%nParticles = SUM(self%particlesPerEdge)
|
||||
|
||||
self%nParticles = SUM(self%particlesPerEdge)
|
||||
!Rescale weight to match flux
|
||||
self%weightPerEdge = fluxPerStep * self%surface / (real(self%nParticles))
|
||||
|
||||
END IF
|
||||
|
||||
!Scale particles for different species steps
|
||||
IF (self%nParticles == 0) CALL criticalError("The number of particles for inject is 0.", 'initInject')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue