Fixed an issue with reflection of particles in all geometries and also

assigning the normal vector in 2D and 3D.

3D Cartesian geometry is working properly, although it needs testing.

Still issue with ionization boundary.
This commit is contained in:
Jorge Gonzalez 2021-03-22 12:39:34 +01:00
commit db6b0a2c03
15 changed files with 349 additions and 265 deletions

View file

@ -13,30 +13,26 @@ MODULE moduleMeshBoundary
!rp = intersection between particle and edge
!rpp = final position of particle
!vpp = final velocity of particle
REAL(8), DIMENSION(1:3):: rp, rpp, vpp
REAL(8), DIMENSION(1:3):: rp, vpp
REAL(8):: tI
REAL(8):: taup !time step for reflecting process
!Reflect particle velocity
vpp = part%v - 2.D0*DOT_PRODUCT(part%v, edge%normal)*edge%normal
part%v = vpp
!Computes the intersection between particle and surface
rp = edge%intersection(part%r, part%v)
rp = edge%intersection(part%r)
!Computes the reflection time step
taup = NORM2(part%r - rp)*tau(part%sp)
part%r = 2.D0*(rp - part%r) + part%r
!New position of particle
rpp = rp + vpp*taup
!assign new parameters to particle
part%r = rpp
part%v = vpp
!particle is assumed to be inside
part%n_in = .TRUE.
END SUBROUTINE reflection
!Absoption in a surface
SUBROUTINE absorption(edge, part)
USE moduleCaseParam
USE moduleSpecies
IMPLICIT NONE
@ -45,7 +41,7 @@ MODULE moduleMeshBoundary
REAL(8):: rpp(1:3) !Position of particle projected to the edge
REAL(8):: d !Distance from particle to edge
rpp = edge%intersection(part%r, part%v)
rpp = edge%intersection(part%r)
d = NORM2(rpp - part%r)