SNURPL1 / 35
Monte Carlo method
May 4, 2010
Prof. Joo Han-gyu
Department of Nuclear Engineering
Reactor Numerical Analysis and Design1st Semester of 2010
Lecture Note 7
SNURPL2 / 35
Statistical Nature of Neutron Reaction
Probability of reaction for a neutron traveling unit distance
Macroscopic Cross section
tdn n dx
( ) t x
tp x e
( , ) : probability for a neutron born som ewhere in the core
to have a collision around , with , (phase space)
p p r E dVdE
r E dV dE
Probability to react within unit distance after traveling x
Mean free path
00 0
( ) t tx x
txp x dx x e dx xe
0
1t x
t
e dx
In core, collision probability
0( ) t x
n x n e
: survival probability after traveling t xe x
1p ≪
? t
SNURPL3 / 35
Statistical Nature of Neutron Reaction
Expected value?
Number of collision for N neutrons born
( , ) 1N kk
N kk N C p p
for collisions out of neutrons, possible number of occurrences k N
of : coeff of the -th order term ( 1 )N
kNa p q i q p
= probability for neutrons (out of N neutrons) to have collisionsk
Expected value of k
0 0
( , ) ?
N N
k N k
N k
k k
k k N k C p q
Expected variance ?
N p
SNURPL4 / 35
Moment Generating Function for PDF
PDF : Probability
Density
Function
0
( ) ( )
N
tx
X
k
M t e p x
The moment-generating function of a random variable is X
probability density function If has a continuous ( ) , then the M GF is given byX p x
( ) ( )tx
XM t e p x dx
( ) ( ) (0) ( ) tx
X XM t xe p x dx E X M xp x dx
( ) ( )( ) ( ) (0) ( )
n n tx n n n
X XM t x e p x dx E X M x p x dx
If has a discrete probability density function ( ) , then the MGF is given byX p x
0 0
( ) ( ) (0) ( )
N N
tx
X X
i i
M t xe p x E X M xp x
2 2 2
0 0
( ) ( ) (0) ( )
N N
tx
X X
i i
M t x e p x E X M x p x
( ) ( )tx
XM t E e
SNURPL5 / 35
Moment Generating Function for PDF
0
( )
N
tk k N k
K N k
k
M t e C p q
E k Np
1
( )N
t t
KM t N pe q pe
Expected value of using MGFk
1(0) ( )
N
KM N p q p Np
0
(0) ( )
N
K
i
E k M k p k
0
Nk
t N k
N k
k
C pe q
N
tpe q
SNURPL6 / 35
Moment Generating Function for PDF
2
2
0
,
N
N
k
k k k N
Expected variance of using MGFk
2 2
0 0 0
, 2 , ,
N N N
k k k
k k N k k k N k k N
2 2
0
2 ,
N
k
k kk k k N
2 22k k k k
0
0
,
, 1
N
k
N
k
k k N k
k N
2 2k k
22
(0) (0)K K
M M
Var k Npq
2 2 2
1N N p Np N p
2
(0) 1K
M N N p Np
2 1
2 2( ) 1
N Nt t t t
KM t N N pe q p e N pe q pe
1Np p
1
( )N
t t
KM t N pe q pe
( )N
t
KM t pe q
( ) R elative standard deviation:
Var k Npq q
k Np Np
~ 1 for 1q p
11
Np N
SNURPL7 / 35
Estimation of p
Estimation of p
Since is unknown, let's find by experimentp p
Repeated Simulation w neutrons/ci eth ycln
Let where is the number of cyclesN n C C
1
1n
i ij
j
p pn
1 if collision in phase space
cycle , neutron0 otherwise
ijp i j
1
1C
i
i
p pC
22
1
1
1
C
s i
i
p pC
2
2 i
s
pp
C
Expected Variance: of p
2
2 1
1
C
i
i
p p
pC C
1 for sam ple variance because of reduced degree of freedom
due to the use in the sam ple m ean. T w o data one deviation.
(conservative estim ation of the real standard dev of the population)
C
SNURPL8 / 35
Central Limit Theorem
the average of a large num ber of independent and identically-distributed random variables
w ill be approxim ately norm ally distributed (i.e., follow ing a G aussian distribution)
if the random var
iables have a finite variance
1 2 3
2
Let x , x , x , ... be a set of independent and identically distributed random va riables
having finite values of mean and variance > 0.
n
2
C etral lim it theorem states that
as the sam ple size increases,
the distribution of the sam ple average approaches the norm al distribution
w ith a m ean and variance irrespec tive
n
n
of the shape of the original distribution.
SNURPL9 / 35
PDF, CDF and Golden Rule
1 2 3 40.0
0.2
0.4
0.6
0.8
1.0
Pro
ba
bili
ty
Case
PDF : Probability Density Function
CDF : Cumulative Distribution Function
( ) : probabilityp x dx
x
f x dx
PDF CD F
Total Area=1
Golden Rule
W ith a CDF given, an event can be picked by a random number .
1 2 3 40.0
0.2
0.4
0.6
0.8
1.0
Pro
ba
bili
tyCase
SNURPL10 / 35
Probability of Collision at x with two regions
0 0
A A B
a sl a l
A BP x e dl e e dl
A
A B
B
,x a0
s
1 2 3 4 5
0.2
0.4
0.6
0.8
1
Aae
1 Aae
xa
1 ,
1 1 ,
A
A A B
x
a a s
e x a
e e e x a
PD F
C D F
: A x
AA p x e
Probability of collision within x
Length of Travel to first collision for a random number
0
( )x
B B
l dla s
B Be e e
( )s x a : A Ba s
BB p x e e
SNURPL11 / 35
MC Simulation of Neutron Migration in 2D with MG Xsec
Problem Geometry 2D core with assembly-wise Xsec
- No heterogeneous configuration within Assembly
- Constant xsec over each FA
Subdivision of each assembly into cells
- Flux averaged over each cell
Neutrons are moving in 3D space, but axially invariant neutron
behavior
Radial BC can be either reflective or vacuum
Cross Sections Multigroup macroscoic cross sections given with scattering
matrices
Scattering is assumed to be isotropic
1 2 1 20 ( , , ) ( , , ) for any and .x y z x y z z z
z
1w hen using diffusion solver data
3t tr
D
SNURPL12 / 35
Things to Consider in Simulating Stochastic Events
Occurring a Neutron Flight
Characterization of a neutron Position (x,y,z)
Moving direction
Energy (g)
Weight (w)
Position of collision in space How long to move from the current position?
Type of interaction absorption, scattering, fission
Scattering mechanism Deflected angle after scattering
Energy after scattering
Fission neutrons emitted Number
Location : Source point in the next simulation
( , ) or ( , , )x y z
SNURPL13 / 35
Shooting a neutron and first move
Get the position of fission source neutron from the storagei th
Determine the energy group of emission using g
Determine the angle of emission assuming isotropic emisssion
- using the angle pickup scheme on the next slide
determine the initial cell number
Determine the first travel distance
SNURPL14 / 35
Selection of Angle
2 2 21
x y z
sin cos
sin sin
cos
x
y
z
Select : 0 ~ 2
Select : 0 ~
2 0 1
( )p d Csin d
2 2
1 2 0 1
sin 1 (cos ) 1
z
z
0.5 1 1.5 2 2.5 3
0.5
1
1.5
2
0
1sin
2d
1(1 )
2z
1.0
0.5
0.75
0.25
x
y
z
x
y
z
0 0
1( ) 2
2p d C sin d C C
0
1: ( ) ( ) 1
2CDF P p d cos
1 1
1
12
z
SNURPL15 / 35
Distance to Move
C : Cummulative Distribution Functions 00
1t t t
s ss s s
tC s e ds e e
( ) (random variable)C s
1 t se
2 2sin 1 cos 1 ( )
xy zs s s s
Straight path of distance
ln(1 ) ln,
t t
s or
x
y
z
s
xys
For given , probality to have collision in after traveling :t
dx s ( ) t s
tp s dx e dx
cos ; sinx xy y xy
s s
SNURPL16 / 35
Segmented Simulation of Flight Across Cells
1 2 3 4 5
0.2
0.4
0.6
0.8
1
Aae
1 Aae
xa
A
B
( ) 1 1A A Ba a sP s e e e
as
Once-through simulation
Segmeted simulation
Requires complicated CDF for more than two cells
Stop first at surface if the first rand om flight distance is obtained longer
than the distance to surface (DTS)
what would be the probability to stop at surface?
Pick a random number for another random flight using B
AaP e
( | ) 1 A Aa sP B A e e
A=Event to move to surface in cell A
B=Event to move by s in cell B Much simpler
SNURPL17 / 35
T he four com bination of sign of x,y directional vector ( , ) determ ines
a possible surface to be reached after c ollision
x y
Determination of Distance to Surface
SNURPL18 / 35
Collision in Current Cell
Fission
Scattering
Absorption
- can occur w ith a prob. ,fg
tg
neutrons per fission
- expected number of fission neutrons per collisionfg
tg
- integer number of fission neutrons fg
tg
int
( 1 ( )) ( 1) ( 1 ( ))a a a a
E int a i P a i i P a i
- can occur w ith a prob.
- group transfer to g can occur w ith , ne ed angle selection
ag
tg
gg
sg
- if not scattering, absorption.
Terminate simulation of the current neutron
R ecord fission for every collision
for m ore spreaded fission sites than
fission only after absorption
Outscattering!
1 ( ) ( 1)( )a a a a
i a i i a i a
SNURPL19 / 35
Treatment of Boundary
Determine if the surface is external boundary
If vacuum surface, terminate migration
If reflective surface, change the moving direction
accordingly
Then sample another move
. . reflection on surface
, ,x x y y z z
e g y z
SNURPL20 / 35
Flow Chart of Simulation of a Neutron Migration
Lxy < DtsMove to surface
Pick up N
(Number of fission)
Determine free flight
distance (L)
, Projection to Plane (Lxy)
Determine distance to
surface (Dts)
n = n+1
(Record position)
Scatter ?
Externel
surface ?
Determine position ,
direction, group
Terminate
(Absorption)
Determine
destination group
Determine direction
ReflectiveTerminate
(vacuum)
Change directionNo
(Absorption)
YesYes
No
Yes
No
Yes No
(In the cell)
fg
tg
int
Record collision of
current cell , s sx x y y
x x y y
for i=1:C
for j=1:n(i)
m igrate
end
( 1)
( )
end
n ik k
n i
shoot
m igra te
collision
SNURPL21 / 35
Flux Scoring (Tally)
Reaction rate of a cell : Rc c c
g tg g cV
C Estimatorollision c
gc
g c
c tg
R
V
Accum ulate the num ber of collisions. S ince source is given per unit tim e,
the scored num ber of collisions can be regarded as collision rate.
T hus dividing it by the volum e and total X sec yields
flux.
Length EstiTrack mator
Expected number of reactions for a track of length formed within a cell:l
Total number of expected reactions within a cell:
Reaction Rate:c c c c
g tg g c tg i
i
R V l
N ote on tim e dim ension
- Although steady-state condition is s im ulated in M C calculation, w e should ad im t that source is
in fact given per unit tim e
where is the track length generated per unit time (in 3D)c
il
track den1
sity!c c
g i
c i
lV
Neutrons passing through a cell should contribute to flux, but missing
in the collision estimator if the neutron just passes a cell, not making any collision
Rl c
g tgl
c c c c
g tg i tg i
i i
R l l
SNURPL22 / 35
Fission Source Treatment
Expected number of fission neutrons at the subsequent generation
in a multiplying medium of 1 for particles simulated eff
k n
effk n
( 1)
1Adjustment of by =
ck
Avoid amplification by in advance
Fission neutron sampling
effk
( )adjust by:
fgc
i
tg
n int
( )New estimate of
ck
( ) ( )Sum up all the fission neutrons generated:
c c
i
i
n n ( )
( ) ( 1)
( 1)
c
c c
fis c
nk k
n
( 1)
1return to normal by correcting the artificial adjustment of by
ck
( ) ( ):
c c
trk i fg
i
Track n l
( )
( )
( 1)
c
c col
col c
nk
n
( ):
fgc
col
i ti
Collision n
( )
( )
( 1)
c
c trk
trk c
nk
n
SNURPL23 / 35
Inactive vs. Active cycles
need inactive cycles to change the spatial source distribution
from the initial definition to a correct distribution for the problem
Active cycle
InActive cycleCycle
avoid excessively large variance encountered in inactive cycles by avoiding tallies
in this phase
because of the unknown source distribution, initial guess of source distribution should be given
causing a lot of variation at the initial phase of cycles.
SNURPL24 / 35
Statistical Processing
Sample mean and variance after active cycle simulations C
( )
1
1
ia
ia
N C
c
col col
c N
k kC
2 ( ) 2
,
1
1 ( )
1
ia
ia
N C
c
k col col col
c N
s k kC
Standard deviation of the sample mean
,
,
k col
k col
s
C
- C onfidence level
( ) 2
1
1 ( ) ( 1)
ia
ia
N C
c
col col
c N
k k C CC
: 68.3%
2 : 95.4%
3 : 99.7%
k
k
k
SNURPL25 / 35
Control Rod
Fission
Absorption
Scattering &
Moderation
Fission chamber
WaterFuel Assembly
Fuel Assembly
Fuel Assembly
Fuel Assembly
Example of particle tracing
L336C 5G 2>
SNURPL26 / 35
Example of particle tracing
L336C 5G 2>
SNURPL27 / 35
0.89
0.9
0.91
0.92
0.93
0.94
0.95
0.96
0.97
0.98
0 50 100 150 200 250 300 350 400 450 500
Cycle
K-eff variation for C5G2 Model Problem
20, 000batch
n
SNURPL28 / 35
Variance Reduction Methods
Need and Approach Reduce the variances of tallies by modifying neutron behavior
- Save neutrons as much as possible instead of killing them while
conserving the mean values of tallies
Analogue vs. Non-Analogue Monte Carlo
Typical MethodsWeight Window Method
Implicit Capture
SNURPL29 / 35
Particle Weight
Concept A single particle being traced in MC simulation is not a single
neutron, rather a group of neutrons
The number of neutrons may be adjusted during the simulation
by introducing weight for each particle
Weight Relative number of neutrons represented by a particle
1
1
1 0
Fission
10
0
Fission10
10
1
10
11
1eff
k 10
110
effk
SNURPL30 / 35
Implicit Capture
Background When an absorption reaction occurs, all the neutrons represented by
the particle disappears at once in analogue MC. This can magnify the
variance of MC calculation
Implementation Do not kill the particle when absorption is selected. Instead, make it
survive with less weight
Weight reduction with survival probability
Collision / Track length / Fission Neutron adjustment
. .f
fis
t
e g P w
= 1sa
t t
w w w
SNURPL31 / 35
Termination of Implicit Capture
Deterministic weight reduction after each collision
Termination Insignificant contribution to tallies if w is too low
Kill if w<w_low, but with a certain probability
Weight adjustment to conserve the weight
- Adjusted weight can potentially lower then the limit
Fixed Adjusted Weight (w_0)
- Adjust survival probability to
DTC
w
s
t
w
2
s
t
w
3
s
t
w
0
0
X
,
lowif w w and
otherw i w
w
w
se w
(0.25) (0.4)low S
w w and
S
ww
( ) 0 (1 )
S S
S
wE w
0
0 0 0
( ) 0 (1 )w w w
E w ww w w
n
s
t
w
02 0.5w if w
SNURPL32 / 35
Modified Calculation Flow for Implicit Capture
Starts
Migration
Routine
Determine
Fission neutron
n = int
( λ*(νΣf/Σt)*w + ζ )
w < 0.25 ?
End
Energy group
change
Direction
change
ζ > w/0.5 ?
Weight reduction
w=w*(Σs/Σt)
Recover the w
w=0.5
Russian Roulette
n = 0 ?Save the fission
site
Starts
Calc
DTC, DTS
Move to
position
DTC < DTS ?Move to
surface
System
Boundary ?
Reflective?
End(leakage)
Flips
Collision
Routine
Transition to
Next region
No
Updates
xsec
migration routine> collision routine>
N
Y
N
Y
SNURPL33 / 35
Effectiveness of Implicit Capture
0.930
0.932
0.934
0.936
0.938
0.940
0.942
0.944
0.946
0.948
0.950
Implicit capture
<Case2 : n=10,000>
Estim
ate
d k
eff
<Case1 : n=1,000>
Reference k=0.93960
Analogue MC
R esult of L336C 5G 2>