300 likes | 327 Views
P HI T S. Multi-Purpose P article and H eavy I on T ransport code S ystem. variance reduction techniques to improve efficiency of calculation B. January 2017 revised. title. Contents of Lecture. Neutron deep penetration calculation. [weight window] Weight windows
E N D
PHITS Multi-Purpose Particle and Heavy Ion Transport code System variance reduction techniques to improve efficiency of calculation B January 2017 revised title
Contents of Lecture Neutron deep penetration calculation • [weight window] Weight windows • [weight window generator] Function of automatically production of [weight window]
Concept of weight in Monte Carlo calculation Example:track length tally Weight: Importance of the particle in Monte Carlo simulation always to be 1 for normal calculation* Artificially increase the probability of rare event occurrences. Frequency distribution per a history cannot be calculated, e.g. [t-deposit] with output = deposit, NO MORE event generator! *Not the case for low-energy neutron transport simulation
Difference between cell importance and weight window methods • “Cell importance method” assign a single value of weight for each cell. • “Weight window method” assign allowed weight range (window) for each cell and each energy group. Efficient simulation with focusing on the important energy region, such as high-energy neutron. WU=2.5 WU=2.5 I1=1 I2=3 WU=1.25 W1=1 W=1 W1=1 Weight Weight Weight WU=0.83 WL=0.5 WL=0.5 W2=1/3 WL=0.25 W2=0.5 region1 region2 WL=0.17 region2 region1 region2 region1 Number of particle1 → energy group1 energy group2 I2/I1=3 1→ W1/W2=2 Number of particle 1 → 1 Cell importance method Weight window method
Parameters Related to Weight Window • wupn: Ratio of the upper and lower limits of allowed weight (D=5.0) • mxspln: Maximum number of split per event (D=5.0) • mwhere: Timing for considering weight window (D=0) -1: reaction, 0: both, 1: crossing surface These parameters should be defined in [parameters] section. See manual “4.2.4Cut off time, cut off weight, and weight window” in more detail.
Check the Trajectory of Single Particle Let’s execute “weight-hist.inp”, and check the neutron trajectory Water (r= 10cm, Depth = 5cm×2) Air 5MeV neutron weight-trajectory.eps
Set [Weight Window] Section Activate the 1st [weight window] section in weight-hist.inp, and execute PHITS! weight-hist.inp [weight window] part = neutron reg ww1 1 0.25 2 0.25 • Lower limit of allowed weights, WL, for each cell is defined in [weight window] • Upper limit of allowed weights, WU, is automatically set to WL x wupn (D=5) Set value in each region Same weight window for all energies WU=5 x WL =1.25 W1=1 Weight WL=0.25 WL=0.25 Cell 1 Cell 2 weight-trajectory.eps Weight of neutron is within the weight window range -> No split and No Russian Roulette
Let’s Decrease Weight Window in Cell 2 weight-hist.inp [weight window] part = neutron reg ww1 1 0.25 2 0.125 Decrease the lower limit of allowed weights in cell 2, and execute PHITS! WU=1.25 W1=1 WU=0.625 Weight WL=0.25 WL=0.125 Cell 2 Cell 1 Particle Split weight-trajectory.eps Neutron is divided into 2 because its weight (=1) is higher than the upper limit (=0.625)
Let’s Decrease Weight Window in Cell 2 EXTREMELY! weight-hist.inp [weight window] part = neutron reg ww1 1 0.25 2 0.005 Decrease the lower limit of allowed weights in cell 2 EXTREMELY, and execute PHITS! WU=1.25 W1=1 Weight WL=0.25 WU=0.025 WL=0.005 Cell 2 Cell 1 weight-trajectory.eps Divided into neutronsof mxspln(D=5) by each event (crossing surface or reaction) It is better to set 2~3 for max weight window ratio between neighboring cells
Set different Weight Window for Each Energy Group weight-hist.inp [weight window] part = neutron eng = 2 0.01 1.0e5 reg ww1 ww2 1 0.25 0.25 2 0.125 0.125 Let’s “off” the 1st [weight window], and activate the 2nd one & execute PHITS Maximum energy for each group • 2 energy groups are defined • But the weight window are the same for each group WU=1.25 WU=1.25 W1=1 W1=1 WU=0.625 WU=0.625 Weight Weight WL=0.25 WL=0.25 WL=0.125 WL=0.125 Cell 1 Cell 2 Cell 1 Cell 2 Particle Split Particle Split 0.01 MeV< E < 105MeV E < 0.01 MeV weight-trajectory.eps Neutron is divided into 2 because its weight (=1) is higher than the upper limit (=0.625) (Same as 2 pages before)
Increase Weight Window Only for Low-Energy Neutrons weight-hist.inp [weight window] part = neutron eng = 2 0.01 1.0e5 reg ww1 ww2 1 0.25*10 0.25 2 0.125*10 0.125 Increase weight window for low-energy neutrons by 10 times, and execute PHITS WU=12.5 WU=6.25 WU=1.25 WL=2.5 Low-energy neutron is killed WL=1.25 W1=1 W1=1 WU=0.625 Weight Weight WL=0.25 WL=0.125 Cell 1 Cell 2 Cell 1 Russian Roulette Cell 2 Particle Split 0.01 MeV< E < 105MeV E < 0.01 MeV weight-trajectory.eps • Reduce the production of low-energy neutrons, and concentrate on high-energy neutron transport simulation • Get poor and better statistics at shallower and deeper locations, respectively
Example of calculation using [weight window] Execute PHITS using weight.inp, and check your CPU time weight.inp Geometry, source, history are the same as imp.inp [weight window] set: c10[1.0] part = neutron eng = 2 1.0e-3 1e5 reg ww1 ww2 1 c10*2.5**(-1) 2.5**(-1) 2 c10*2.5**(-2) 2.5**(-2) 3 c10*2.5**(-3) 2.5**(-3) ・・・ Cylindrical Concrete (r = 50cm, depth = 1.8 m) 14MeV neutron Depth of each cell = 15 cm total cpu time = 25.89 sec • Decrease weight window of neighboring cells by 1/2.5 for particle split • Set same weight window for all energy groups (because c10=1.0) weight-dose-xz_err.eps weight-dose-xz.eps
Example of calculation using [weight window] Increase the weight window for low-energy neutrons by 10 times, and execute PHITS weight.inp [weight window] set: c10[10.0] part = neutron eng = 2 1.0e-3 1e5 reg ww1 ww2 1 c10*2.5**(-1) 2.5**(-1) 2 c10*2.5**(-2) 2.5**(-2) 3 c10*2.5**(-3) 2.5**(-3) ・・・ Most low-energy neutrons are immediately killed when they produced, because of Russian Roulette Low-energy neutrons have short range, so statistical uncertainties of deeper locations do not change that much 14.53 sec total cpu time = 25.89-> weight-dose-xz_err.eps weight-dose-xz.eps
Comparison of CPU time Normal calculation (No [importance], No [weight window]) total cpu time = 19.53 sec Use [importance] total cpu time = 50.49 sec Use [weight window]; same value for all energies total cpu time = 25.89 sec Use [weight window]; different values for low- and high-energy neutrons total cpu time = 14.53 sec
Dose Reduction Rate in Concrete 90 cm 180 cm Good agreement except for deeper locationdoses obtained from default setting You can improve the efficiency of your calculation by appropriately setting weight window for each neutron energy group
Contents of Lecture Neutron deep penetration calculation • [weight window] Weight windows • [weight window generator] Function of automatically production of [weight window]
Weight Window Generator[t-WWG] Tally to generate appropriate weight window automatically in each cell mesh=reg only because [weight window] allows mesh=reg. 【Procedure of automatically generation】 • To generate the weight window, track length of particle normalized by a volume in each cell is calculated (flux: 1/cm2). Same method with [t-track]. • It is necessary to define a volume in each cell in [volume] section. [ T - WWG ] mesh = reg reg = {1-12} part = neutron e-type = 1 ne = 2 0 0.01 1e5 axis = wwg file = WWG.out • The weight window is given by a flux in each cell normalized by the maximum flux. • In a cell where flux is zero, the weight window is given by the minimum flux with finite value. • This procedure applies to each particle and energy bin.
Neutron Deep Penetration Calculation with WWG Calculate neutron transport in thick shield and dose rate distribution to depth Execute “imp.inp” and check geometry. WWG.inp [ P a r a m e t e r s ] icntl = 8 maxcas = 1500 maxbch = 1 … 14MeV neutron weight-dose-xz.eps 100 cm radius x 180 cm thick cylinder
Check Output file of [t-WWG] Let’s execute “WWG.inp” with icntl=0, and check “WWG.out”. WWG.out Initial value of weight window [ T - WWG ] mesh = reg reg = {1-12} part = neutron e-type = 1 ne = 2 $ 2 energy bin 0 0.01 1e5 axis = wwg file = WWG.out WWG.inp [ Weight Window ] set: c71[0.0] c72[c71+6.18192E-08] c73[4.05578E-05] set: c74[0.0] c75[c74+3.62115E-08] c76[4.93165E-05] part = neutron eng = 2 1.00000E-02 1.00000E+05 reg ww1 ww2 1 (2.83044E-05+c71)/c73 (4.93165E-05+c74)/c76 2 (4.05578E-05+c71)/c73 (3.19034E-05+c74)/c76 3 (2.60679E-05+c71)/c73 (1.44445E-05+c74)/c76 4 (1.57570E-05+c71)/c73 (5.69405E-06+c74)/c76 5 (7.55214E-06+c71)/c73 (1.90163E-06+c74)/c76 6 (2.19087E-06+c71)/c73 (4.12666E-07+c74)/c76 7 (7.66554E-07+c71)/c73 (2.08198E-07+c74)/c76 8 (3.21984E-07+c71)/c73 (3.62115E-08+c74)/c76 9 (8.12275E-08+c71)/c73 (0.00000E+00+c75)/c76 10 (6.18192E-08+c71)/c73 (0.00000E+00+c75)/c76 11 (0.00000E+00+c72)/c73 (0.00000E+00+c75)/c76 12 (0.00000E+00+c72)/c73 (0.00000E+00+c75)/c76 Maximum flux Minimum flux weight-dose-xz_err.eps WWG gives minimum value in the cell where flux is zero. Without weight window
Particle Deep Penetration Calculation with WWG Method for efficient deep penetration of particles using results of [t-WWG] • In the 1st transport calculation, the initial weight window are generated by [t-WWG]. • In the 2nd, the weight window are updated by initial values of weight window. • After the 3rd, calculations are repeated until particles are transported to overall, and then you can obtain the appropriate weight window. • After checking the weight window, you can adjust the total history.
Recalculation using Output Results of [t-WWG] Activate the infl: {WWG.out} in “WWG.inp”, and execute PHITS WWG.out The weight window obtained by the 2nd calculation • Total history = 1,500 [ Weight Window ] set: c71[0.0] c72[c71+2.96119E-09] c73[3.91181E-05] set: c74[0.0] c75[c74+4.17101E-10] c76[5.18131E-05] part = neutron eng = 2 1.00000E-02 1.00000E+05 reg ww1 ww2 1 (2.66412E-05+c71)/c73 (5.18131E-05+c74)/c76 2 (3.91181E-05+c71)/c73 (3.20976E-05+c74)/c76 3 (3.17312E-05+c71)/c73 (1.54521E-05+c74)/c76 4 (1.63019E-05+c71)/c73 (5.74496E-06+c74)/c76 5 (5.72250E-06+c71)/c73 (2.10764E-06+c74)/c76 6 (2.61249E-06+c71)/c73 (7.63598E-07+c74)/c76 7 (1.22491E-06+c71)/c73 (2.59539E-07+c74)/c76 8 (4.61954E-07+c71)/c73 (7.34882E-08+c74)/c76 9 (1.38622E-07+c71)/c73 (2.04334E-08+c74)/c76 10 (3.83122E-08+c71)/c73 (7.22860E-09+c74)/c76 11 (9.83027E-09+c71)/c73 (1.91995E-09+c74)/c76 12 (2.96119E-09+c71)/c73 (4.17101E-10+c74)/c76 Use the 1st weight window “WWG.out” is updated every execution Do not change input file name “WWG.inp” weight-dose-xz_err.eps There is no region where flux is zero.
Execute 3rd Calculation Let’s execute 3rd calculation and check distribution to depth and radial directions. • Total history = 1,500 Use the 2nd weight window. “WWG.out” is updated every execution. weight-dose-reg.eps Dose reduction rate in concrete weight-dose-xz_err.eps *Statistic of photon dose in deeper location is not enough because WWG is not applied to photon. As the same weight window is used in a cell, the large difference among fluxes in a cell causes a region with poor statistic in a cell.
Divide Cell to Radial Direction Let’s execute “WWG2.inp” with cells divided to radial direction and check geometry. Calculate the effective dose rate in cell 60 (r=80-100 cm, z=165-180 cm). WWG2.inp [ P a r a m e t e r s ] icntl = 8 maxcas = 1500 maxbch = 1 emin(2) = 1.000000000E-10 dmax(2) = 20.0000000 file(6) = phits.out file(7) = c:/phits/data/xsdir.jnd file(14) = c:/phits/data/trxcrd.dat $ infl: {WWG2.out} … weight-dose-xz.eps Divide cell into 5 parts to radial direction R=0~20cm, 20~40cm, 40~60cm,60~80cm, 80~100 cm
Particle Transport Calculation in Geometry with Cell Divided to Radial Direction Let’s execute 1st calculation using “WWG2.inp” with “icntl=0” and generate the initial weight window. • Total history = 1,500 WWG2.out [ Weight Window ] set: c71[0.0] c72[c71+6.27275E-09] c73[3.92226E-04] set: c74[0.0] c75[c74+2.62288E-08] c76[1.08982E-03] part = neutron eng = 2 1.00000E-02 1.00000E+05 reg ww1 ww2 1 (3.56827E-04+c71)/c73 (1.08982E-03+c74)/c76 2 (3.92226E-04+c71)/c73 (5.76617E-04+c74)/c76 3 (2.31423E-04+c71)/c73 (2.24747E-04+c74)/c76 4 (1.16118E-04+c71)/c73 (6.43446E-05+c74)/c76 …… weight-dose-xz_err.eps Without weight window
Particle Transport Calculation in Geometry with Cell Divided to Radial Direction Let’s activate theinfl: {WWG2.out} in “WWG2.inp” and execute 2nd and 3rd calculations. weight-dose-xz_err.eps weight-dose-xz_err.eps weight-dose-xz_err.eps 【reference】 Results of 3rd calculation with “WWG.inp” Results of 2nd calculation Results of 3rd calculation Divide cell to transport particles overall efficiently
Increase the number of history and check effective dose rate Change maxbch=5 in WWG2.inp, increase the number of history, and execute calculation Calculate dose rate in cell 60(r=80-100 cm, z=165-180 cm) • Check dose rate in “weight-dose-reg.out” weight-dose-reg.out x: Serial Num. of Region y: dose [(\muSv/h)/(source/sec)] p: xlin ylog afac(0.8) form(0.9) h: x n n y(neutron ),l3 n # num reg volume neutron r.err 49 49 1.6965E+05 1.3290E-07 0.0825 50 50 1.6965E+05 1.8817E-07 0.0629 51 51 1.6965E+05 1.7246E-07 0.0541 52 52 1.6965E+05 1.2527E-07 0.0535 53 53 1.6965E+05 7.5867E-08 0.0561 54 54 1.6965E+05 4.0648E-08 0.0549 55 55 1.6965E+05 2.0491E-08 0.0579 56 56 1.6965E+05 9.0972E-09 0.0592 57 57 1.6965E+05 3.7623E-09 0.0617 58 58 1.6965E+05 1.4940E-09 0.0682 59 59 1.6965E+05 5.5295E-10 0.0707 60 60 1.6965E+05 1.7702E-10 0.0732 weight-dose-xz_err.eps *omit photon dose rate
Task: Deep Penetration Calculation for 14 MeV Photon Let’s change the [source] section in “WWG2.inp” to use 14 MeV photon with isotropic direction and calculate photon dose rate in cell 60. Firstly, generate the initial weight window with [t-WWG]. • Initial history number (maxcas=1500, maxbch=1) • Disable “infl command” • In [T-WWG], particle is photon, energy bin is 0-1MeV and 1-105MeV. WWG2.inp for this task [ P a r a m e t e r s ] icntl = 0 maxcas = 1500 maxbch = 1 … $ infl: {WWG2.out} [ T - WWG ] mesh = reg reg = {1-60} part = photon e-type = 1 ne = 2 0 1 1e5 … [ S o u r c e ] s-type = 1 proj = photon e0 = 14.00 … dir = all weight-dose-xz_err.eps Without weight window
Task: Deep Penetration Calculation for 14 MeV Photon • Activate infl command and use the initial weight window weight-dose-xz_err.eps Warning due to many particle productions Without weight window Small values of weight window are set in a cell where photon does not come, and the number of split particle increases. It is better to increase the number of history and transportation of particles to generate the initial weight window.
Task: Deep Penetration Calculation for 14 MeV Photon • Change History number(maxcas=30000, maxbch=1), disableinfl command and generate the initial weight window • Activate infl command and calculate dose rate in cell 60 with the initial weight window weight-dose-xz_err.eps With the initial weight window weight-dose-xz_err.eps Cell60 8.27E-11(μSv/h)/(source/sec) Statistical error 0.0594 Without weight window
Summary • “Weight window method” assign allowed weight range (window) for each cell and each energy group. • [t-WWG] generate appropriate weight window automatically in each cell and energy. • The weight window is given by a flux in each cell normalized by the maximum flux. • It is necessary to define a volume in each cell in [volume] section. • It is convenient for particle transport calculation to read output file of [t-WWG](= the [weight window] section) by the infl command except for the 1st calculation. • Note that warning message due to many particle productions appears when statistics of the 1st calculation is very bad.