Some progress
Fixed an issue with random integer numbers.
Cylindrical coordinates are not perfect yet:
- Box (cylinder) with initial constant density loses particles at r =
0
- Injection density still low in r = 0
This commit is contained in:
parent
6b5ac16e4b
commit
626e970d82
5 changed files with 31 additions and 8 deletions
|
|
@ -313,12 +313,12 @@ MODULE moduleInject
|
|||
|
||||
!$OMP DO
|
||||
DO n = nMin, nMax
|
||||
randomX = random(1, self%nEdges)
|
||||
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 * sqrt(partInj(n)%r(2) / (0.1D0/L_ref))
|
||||
partInj(n)%weight = self%species%weight
|
||||
!Volume associated to the edge:
|
||||
IF (ASSOCIATED(randomEdge%e1)) THEN
|
||||
partInj(n)%cell = randomEdge%e1%n
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue