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:
parent
12e61731df
commit
2a843547b8
8 changed files with 128 additions and 24 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue