forked from weft/warp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
executable file
·89 lines (79 loc) · 1.68 KB
/
test.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#! /usr/bin/env python
import warp
# init setup container
geom = warp.wgeometry()
# make materials
n_topes = 4
prim_id = 0
assemblyname = "assembly"
topes= warp.Unsigned(n_topes)
fracs_fuel = warp.Float(n_topes)
fracs_water = warp.Float(n_topes)
mins = warp.Float(3)
maxs = warp.Float(3)
origin = warp.Float(3)
topes[0] = 92235
topes[1] = 92238
topes[2] = 8016
topes[3] = 1001
fracs_fuel[0] = 0.1
fracs_fuel[1] = 0.9
fracs_fuel[2] = 2
fracs_fuel[3] = 0
fracs_water[0] = 0
fracs_water[1] = 0
fracs_water[2] = 1
fracs_water[3] = 2
dens_fuel = 15
dens_water = 3
geom.add_material(1,1,n_topes,dens_fuel, topes,fracs_fuel)
geom.add_material(2,0,n_topes,dens_water,topes,fracs_water)
# run name stuff
tallycell = 316 #center pin
filename = assemblyname
tallyname = assemblyname
tallyname = assemblyname+".tally"
# assembly geom
typ=1
material=1
mins[0]=-1.0
mins[1]=-1.0
mins[2]=-20.0
maxs[0]= 1.0
maxs[1]= 1.0
maxs[2]= 20.0
origin[0]=0.0
origin[1]=0.0
origin[2]=0.0
prim_id=geom.add_primitive(typ,material,mins,maxs,origin)
print prim_id
geom.make_hex_array(prim_id,15,0.0,0.0,1.164,1)
typ=0
material=2
mins[0]=-48
mins[1]=-48
mins[2]=-48
maxs[0]=48
maxs[1]=48
maxs[2]=48
prim_id=geom.add_primitive(typ,material,mins,maxs,origin)
print prim_id
idx=geom.add_transform(prim_id,999,0,0,0,0,0)
# finalize geom and check
geom.set_outer_cell(999)
geom.update()
geom.check()
#geom.print_all()
geom.print_summary()
# init hist and run
hist = warp.whistory(100000,geom)
hist.set_device(0)
hist.init()
hist.print_xs_data()
hist.print_materials_table()
hist.set_run_type("criticality")
hist.set_tally_cell(tallycell)
hist.set_run_param(40,20)
hist.set_filename(filename)
hist.run()
hist.write_tally(0)