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...
This commit is contained in:
Jorge Gonzalez 2024-06-29 22:22:10 +02:00
commit 4cadfe5367
2 changed files with 6 additions and 23 deletions

View file

@ -586,32 +586,16 @@ MODULE moduleMesh2DCyl
!Computes volume per node
Xi = (/-5.D-1, -5.D-1, 0.D0/)
r = self%gatherF(Xi, 4, self%r)
self%n1%v = self%n1%v + fPsi(1)*r*detJ*PI8
IF (self%r(1) == 0.D0) THEN
self%n1%v = self%n1%v * PI / 2.D0
END IF
self%n1%v = self%n1%v + fPsi(1)*self%volume
Xi = (/ 5.D-1, -5.D-1, 0.D0/)
r = self%gatherF(Xi, 4, self%r)
self%n2%v = self%n2%v + fPsi(2)*r*detJ*PI8
IF (self%r(2) == 0.D0) THEN
self%n2%v = self%n2%v * PI / 2.D0
END IF
self%n2%v = self%n2%v + fPsi(2)*self%volume
Xi = (/ 5.D-1, 5.D-1, 0.D0/)
r = self%gatherF(Xi, 4, self%r)
self%n3%v = self%n3%v + fPsi(3)*r*detJ*PI8
IF (self%r(3) == 0.D0) THEN
self%n3%v = self%n3%v * PI / 2.D0
END IF
self%n3%v = self%n3%v + fPsi(3)*self%volume
Xi = (/-5.D-1, 5.D-1, 0.D0/)
r = self%gatherF(Xi, 4, self%r)
self%n4%v = self%n4%v + fPsi(4)*r*detJ*PI8
IF (self%r(4) == 0.D0) THEN
self%n4%v = self%n4%v * PI / 2.D0
END IF
self%n4%v = self%n4%v + fPsi(4)*self%volume
END SUBROUTINE volumeQuad

View file

@ -306,8 +306,6 @@ MODULE moduleInject
nMin = nMin + 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
partInj(nMin:nMax)%n_in = .FALSE.
!$OMP END SINGLE
@ -315,10 +313,11 @@ MODULE moduleInject
!$OMP DO
DO n = nMin, nMax
randomX = randomWeighted(self%cumWeight, self%sumWeight)
randomEdge => mesh%edges(self%edges(randomX))%obj
!Random position in edge
partInj(n)%r = randomEdge%randPos()
!Assign weight to particle.
partInj(n)%weight = self%species%weight
!Volume associated to the edge:
IF (ASSOCIATED(randomEdge%e1)) THEN
partInj(n)%cell = randomEdge%e1%n