Final implementation of ionization process by electron impact.
Possibility to input initial species distributions (density, velocity
and temperature) via an input file for each species.
New moduleRandom includes function to generate random numbers in
different ways (still uses) the implicit RANDOM_NUMBER().
This commit is contained in:
parent
e50cc3325b
commit
9e0d1a7cc7
16 changed files with 363 additions and 86 deletions
|
|
@ -174,21 +174,14 @@ MODULE moduleInject
|
|||
|
||||
!Random velocity from Maxwellian distribution
|
||||
FUNCTION randomVelMaxwellian(self) RESULT (v)
|
||||
USE moduleConstParam, ONLY: PI
|
||||
USE moduleRandom
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(velDistMaxwellian), INTENT(in):: self
|
||||
REAL(8):: v
|
||||
REAL(8):: x, y
|
||||
v = 0.D0
|
||||
x = 0.D0
|
||||
|
||||
DO WHILE (x == 0.D0)
|
||||
CALL RANDOM_NUMBER(x)
|
||||
END DO
|
||||
CALL RANDOM_NUMBER(y)
|
||||
|
||||
v = self%v + self%vTh*DSQRT(-2.D0*DLOG(x))*DCOS(2.D0*PI*y)
|
||||
v = self%v + self%vTh*randomMaxwellian()
|
||||
|
||||
END FUNCTION randomVelMaxwellian
|
||||
|
||||
|
|
@ -208,6 +201,7 @@ MODULE moduleInject
|
|||
USE moduleSpecies
|
||||
USE moduleSolver
|
||||
USE moduleMesh
|
||||
USE moduleRandom
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(injectGeneric), INTENT(in):: self
|
||||
|
|
@ -215,7 +209,6 @@ MODULE moduleInject
|
|||
INTEGER:: i!, j
|
||||
INTEGER, SAVE:: nMin, nMax !Min and Max index in partInj array
|
||||
INTEGER:: n
|
||||
REAL(8):: rnd
|
||||
CLASS(meshEdge), POINTER:: randomEdge
|
||||
|
||||
!Insert particles
|
||||
|
|
@ -243,8 +236,7 @@ MODULE moduleInject
|
|||
|
||||
!$OMP DO
|
||||
DO n = nMin, nMax
|
||||
CALL RANDOM_NUMBER(rnd)
|
||||
randomX = INT(DBLE(self%nEdges-1)*rnd) + 1
|
||||
randomX = random(1, self%nEdges)
|
||||
|
||||
randomEdge => mesh%edges(self%edges(randomX))%obj
|
||||
!Random position in edge
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue