Ionization boundary condition fully tested.

Documentation updated properly.

3D Cartesian geometry also tested.
Documentation updated properly.

Added weighting probability in the injection of particles.
This commit is contained in:
Jorge Gonzalez 2021-03-27 11:38:18 +01:00
commit 2a843547b8
8 changed files with 128 additions and 24 deletions

View file

@ -66,4 +66,18 @@ MODULE moduleRandom
END FUNCTION randomMaxwellian
!Returns a random number weighted with the cumWeight array
FUNCTION randomWeighted(cumWeight, sumWeight) RESULT(rnd)
IMPLICIT NONE
REAL(8), INTENT(in):: cumWeight(1:)
REAL(8), INTENT(in):: sumWeight
REAL(8):: rnd0b
INTEGER:: rnd
rnd0b = random(0.D0, sumWeight)
rnd = MINLOC(DABS(rnd0b - cumWeight), 1)
END FUNCTION randomWeighted
END MODULE moduleRandom