-
Notifications
You must be signed in to change notification settings - Fork 5
/
WriteTally.py
31 lines (30 loc) · 1.79 KB
/
WriteTally.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from MCNPtools import Gen
# example usage of the module
# first you initialize the tally by defining the bins: segment (surface number), angle (cosine) and energy (MeV)
cos = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]
seg = [666,667]
erg =[1.000E-10, 1.259E-10, 1.585E-10, 1.995E-10, 2.512E-10, 3.162E-10,
3.981E-10, 5.012E-10, 6.310E-10, 7.943E-10, 1.000E-09, 1.259E-09,
1.585E-09, 1.995E-09, 2.512E-09, 3.162E-09, 3.981E-09, 5.012E-09,
6.310E-09, 7.943E-09, 1.000E-08, 1.259E-08, 1.585E-08, 1.995E-08,
2.512E-08, 3.162E-08, 3.981E-08, 5.012E-08, 6.310E-08, 7.943E-08,
1.000E-07, 1.259E-07, 1.585E-07, 1.995E-07, 2.512E-07, 3.162E-07,
3.981E-07, 5.012E-07, 6.310E-07, 7.943E-07, 1.000E-06, 1.259E-06,
1.585E-06, 1.995E-06, 2.512E-06, 3.162E-06, 3.981E-06, 5.012E-06,
6.310E-06, 7.943E-06, 1.000E-05, 1.259E-05, 1.585E-05, 1.995E-05,
2.512E-05, 3.162E-05, 3.981E-05, 5.012E-05, 6.310E-05, 7.943E-05,
1.000E-04, 1.259E-04, 1.585E-04, 1.995E-04, 2.512E-04, 3.162E-04,
3.981E-04, 5.012E-04, 6.310E-04, 7.943E-04, 1.000E-03, 1.259E-03,
1.585E-03, 1.995E-03, 2.512E-03, 3.162E-03, 3.981E-03, 5.012E-03,
6.310E-03, 7.943E-03, 1.000E-02, 1.259E-02, 1.585E-02, 1.995E-02,
2.512E-02, 3.162E-02, 3.981E-02, 5.012E-02, 6.310E-02, 7.943E-02,
1.000E-01, 1.259E-01, 1.585E-01, 1.995E-01, 2.512E-01, 3.162E-01,
3.981E-01, 5.012E-01, 6.310E-01, 7.943E-01, 1.000E+00, 1.259E+00,
1.585E+00, 1.995E+00, 2.512E+00, 3.162E+00, 3.981E+00, 5.012E+00,
6.310E+00, 7.943E+00, 1.000E+01, 1.259E+01, 1.585E+01, 1.995E+01]
myTally = Gen.Tally(seg,cos,erg)
# Once the object is initlialized it can be used to print out the tally needed by MCNP giving:
# surface -> 999
# title -> test
# normFactor -> 1
myTally.PrintTally(681,"test",9.6E+13)