Correction to ensure always correct direction in the injection
This commit is contained in:
parent
2b6ea0ff84
commit
8ae558f3c8
1 changed files with 7 additions and 7 deletions
|
|
@ -391,15 +391,15 @@ MODULE moduleInject
|
||||||
partInj(n)%v = self%vMod*direction + (/ self%v(1)%obj%randomVel(), &
|
partInj(n)%v = self%vMod*direction + (/ self%v(1)%obj%randomVel(), &
|
||||||
self%v(2)%obj%randomVel(), &
|
self%v(2)%obj%randomVel(), &
|
||||||
self%v(3)%obj%randomVel() /)
|
self%v(3)%obj%randomVel() /)
|
||||||
|
!If injecting a no-drift distribution and velocity is negative, reflect
|
||||||
|
if ((self%vMod == 0.D0) .and. &
|
||||||
|
(dot_product(direction, partInj(n)%v) < 0.D0)) then
|
||||||
|
partInj(n)%v = - partInj(n)%v
|
||||||
|
|
||||||
|
end if
|
||||||
|
|
||||||
end do
|
end do
|
||||||
|
|
||||||
!If injecting a no-drift distribution and velocity is negative, reflect
|
|
||||||
if ((self%vMod == 0.D0) .and. &
|
|
||||||
(dot_product(direction, partInj(n)%v) < 0.D0)) then
|
|
||||||
partInj(n)%v = - partInj(n)%v
|
|
||||||
|
|
||||||
end if
|
|
||||||
|
|
||||||
!Obtain natural coordinates of particle in cell
|
!Obtain natural coordinates of particle in cell
|
||||||
partInj(n)%Xi = mesh%cells(partInj(n)%cell)%obj%phy2log(partInj(n)%r)
|
partInj(n)%Xi = mesh%cells(partInj(n)%cell)%obj%phy2log(partInj(n)%r)
|
||||||
!Push new particle with the minimum time step
|
!Push new particle with the minimum time step
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue