Change in injection to achieve uniform density of particles. #50
2 changed files with 6 additions and 23 deletions
Seems are a bit better
There is still less density in the axis. I don't find a reason why. There must be a modification to the weight...
commit
4cadfe5367
|
|
@ -586,32 +586,16 @@ MODULE moduleMesh2DCyl
|
||||||
!Computes volume per node
|
!Computes volume per node
|
||||||
Xi = (/-5.D-1, -5.D-1, 0.D0/)
|
Xi = (/-5.D-1, -5.D-1, 0.D0/)
|
||||||
r = self%gatherF(Xi, 4, self%r)
|
r = self%gatherF(Xi, 4, self%r)
|
||||||
self%n1%v = self%n1%v + fPsi(1)*r*detJ*PI8
|
self%n1%v = self%n1%v + fPsi(1)*self%volume
|
||||||
IF (self%r(1) == 0.D0) THEN
|
|
||||||
self%n1%v = self%n1%v * PI / 2.D0
|
|
||||||
|
|
||||||
END IF
|
|
||||||
Xi = (/ 5.D-1, -5.D-1, 0.D0/)
|
Xi = (/ 5.D-1, -5.D-1, 0.D0/)
|
||||||
r = self%gatherF(Xi, 4, self%r)
|
r = self%gatherF(Xi, 4, self%r)
|
||||||
self%n2%v = self%n2%v + fPsi(2)*r*detJ*PI8
|
self%n2%v = self%n2%v + fPsi(2)*self%volume
|
||||||
IF (self%r(2) == 0.D0) THEN
|
|
||||||
self%n2%v = self%n2%v * PI / 2.D0
|
|
||||||
|
|
||||||
END IF
|
|
||||||
Xi = (/ 5.D-1, 5.D-1, 0.D0/)
|
Xi = (/ 5.D-1, 5.D-1, 0.D0/)
|
||||||
r = self%gatherF(Xi, 4, self%r)
|
r = self%gatherF(Xi, 4, self%r)
|
||||||
self%n3%v = self%n3%v + fPsi(3)*r*detJ*PI8
|
self%n3%v = self%n3%v + fPsi(3)*self%volume
|
||||||
IF (self%r(3) == 0.D0) THEN
|
|
||||||
self%n3%v = self%n3%v * PI / 2.D0
|
|
||||||
|
|
||||||
END IF
|
|
||||||
Xi = (/-5.D-1, 5.D-1, 0.D0/)
|
Xi = (/-5.D-1, 5.D-1, 0.D0/)
|
||||||
r = self%gatherF(Xi, 4, self%r)
|
r = self%gatherF(Xi, 4, self%r)
|
||||||
self%n4%v = self%n4%v + fPsi(4)*r*detJ*PI8
|
self%n4%v = self%n4%v + fPsi(4)*self%volume
|
||||||
IF (self%r(4) == 0.D0) THEN
|
|
||||||
self%n4%v = self%n4%v * PI / 2.D0
|
|
||||||
|
|
||||||
END IF
|
|
||||||
|
|
||||||
END SUBROUTINE volumeQuad
|
END SUBROUTINE volumeQuad
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -306,8 +306,6 @@ MODULE moduleInject
|
||||||
|
|
||||||
nMin = nMin + 1
|
nMin = nMin + 1
|
||||||
nMax = nMin + self%nParticles - 1
|
nMax = nMin + self%nParticles - 1
|
||||||
!Assign weight to particle.
|
|
||||||
partInj(nMin:nMax)%weight = self%species%weight
|
|
||||||
!Particle is considered to be outside the domain
|
!Particle is considered to be outside the domain
|
||||||
partInj(nMin:nMax)%n_in = .FALSE.
|
partInj(nMin:nMax)%n_in = .FALSE.
|
||||||
!$OMP END SINGLE
|
!$OMP END SINGLE
|
||||||
|
|
@ -315,10 +313,11 @@ MODULE moduleInject
|
||||||
!$OMP DO
|
!$OMP DO
|
||||||
DO n = nMin, nMax
|
DO n = nMin, nMax
|
||||||
randomX = randomWeighted(self%cumWeight, self%sumWeight)
|
randomX = randomWeighted(self%cumWeight, self%sumWeight)
|
||||||
|
|
||||||
randomEdge => mesh%edges(self%edges(randomX))%obj
|
randomEdge => mesh%edges(self%edges(randomX))%obj
|
||||||
!Random position in edge
|
!Random position in edge
|
||||||
partInj(n)%r = randomEdge%randPos()
|
partInj(n)%r = randomEdge%randPos()
|
||||||
|
!Assign weight to particle.
|
||||||
|
partInj(n)%weight = self%species%weight
|
||||||
!Volume associated to the edge:
|
!Volume associated to the edge:
|
||||||
IF (ASSOCIATED(randomEdge%e1)) THEN
|
IF (ASSOCIATED(randomEdge%e1)) THEN
|
||||||
partInj(n)%cell = randomEdge%e1%n
|
partInj(n)%cell = randomEdge%e1%n
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue