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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
|
#!/usr/bin/python3
import openmc
import math
import argparse
import hashlib
import sys
import time
# KRUSTY Model in OpenMC
# C.Moore, <connor.moore@psi.ch>
############ COMMAND LINE ARGUMENTS ############
cli_parser = argparse.ArgumentParser(
prog="KRUSTY Heat Pipe Study",
description="Program to investigate the reactivity effect of heat pipe saturation on the KRUSTY reactor."
)
cli_parser.add_argument("-s","--sat-height",default=5.5,type=float,help="Height of wick that is saturated with Na starting at the bottom of the heat pipe (0-45) [cm], default 25.0")
cli_parser.add_argument("-p","--pool-height",default=5.0,type=float,help="Height of Na pool starting at the bottom of the heat pipe (0-45) [cm], default 5.0")
cli_parser.add_argument("-l","--lclrs",default=False,action="store_true",help="Flag for specifying LCLRS accessible cross-sections, default false.")
cli_parser.add_argument("-r","--run",default=False,action="store_true",help="Whether or not to automatically run OpenMC, default false.")
cli_args = cli_parser.parse_args()
if cli_args.pool_height < 0.0 or cli_args.pool_height > 100.0:
sys.exit(f"Error: Invalid sodium pool height of {cli_args.pool_height} cm. Value must be between 0.0 and 100.0 inclusive.")
if cli_args.sat_height < 0.0 or cli_args.sat_height > 100.0:
sys.exit(f"Error: Invalid saturated wick height of {cli_args.sat_height} cm. Value must be between 0.0 and 100.0 inclusive.")
if cli_args.lclrs:
openmc.config["cross_sections"] = "/libs/endfb81_official/cross_sections.xml"
############ INTPUT-OUTPUT MAPPING ############
path = sys.argv[0]
with open(path, "rb") as file:
contents = file.read()
filehash = hashlib.md5(contents).hexdigest()
print("="*60)
print(f"Run date CET: {time.ctime()}")
print(f"Input file MD5: {filehash}")
print(f"Input arguments: {cli_args}")
print("="*60)
############ MATERIALS ############
mat_list = []
mat_temp_global = 900
mat_temp_fuel = 900
mat_hp_wick_porosity = 0.7
## 100 - Structural Materials ##
mat_haynes230 = openmc.Material(100,name='Structural HAYNES 230')
mat_haynes230.add_element('Ni',57,'wo')
mat_haynes230.add_element('Cr',22,'wo')
mat_haynes230.add_element('W',14,'wo')
mat_haynes230.add_element('Mo', 2,'wo')
mat_haynes230.add_element('Fe', 1.875,'wo')
mat_haynes230.add_element('Co', 3.125,'wo')
mat_haynes230.temperature = mat_temp_global
mat_haynes230.set_density('g/cm3',8.97)
mat_list.append(mat_haynes230)
mat_ss316 = openmc.Material(101,name='Structural SS316')
mat_ss316.add_element('C', 9.12187E-02+1.01457E-03, 'ao')
mat_ss316.add_nuclide('Si28', 1.10957E+00, 'ao')
mat_ss316.add_nuclide('Si29', 5.61820E-02, 'ao')
mat_ss316.add_nuclide('Si30', 3.72944E-02, 'ao')
mat_ss316.add_nuclide('Cr50', 7.94742E-01, 'ao')
mat_ss316.add_nuclide('Cr52', 1.53260E+01, 'ao')
mat_ss316.add_nuclide('Cr53', 1.73763E+00, 'ao')
mat_ss316.add_nuclide('Cr54', 4.32580E-01, 'ao')
mat_ss316.add_nuclide('Mn55', 1.77454E+00, 'ao')
mat_ss316.add_nuclide('Fe54', 4.11552E+00, 'ao')
mat_ss316.add_nuclide('Fe56', 6.39783E+01, 'ao')
mat_ss316.add_nuclide('Fe57', 1.46483E+00, 'ao')
mat_ss316.add_nuclide('Fe58', 1.95315E-01, 'ao')
mat_ss316.add_nuclide('Ni58', 5.91824E+00, 'ao')
mat_ss316.add_nuclide('Ni60', 2.26262E+00, 'ao')
mat_ss316.add_nuclide('Ni61', 9.79589E-02, 'ao')
mat_ss316.add_nuclide('Ni62', 3.11211E-01, 'ao')
mat_ss316.add_nuclide('Ni64', 7.88874E-02, 'ao')
mat_ss316.add_nuclide('Mo92', 3.21318E-02, 'ao')
mat_ss316.add_nuclide('Mo94', 2.00286E-02, 'ao')
mat_ss316.add_nuclide('Mo95', 3.44709E-02, 'ao')
mat_ss316.add_nuclide('Mo96', 3.61161E-02, 'ao')
mat_ss316.add_nuclide('Mo97', 2.06783E-02, 'ao')
mat_ss316.add_nuclide('Mo98', 5.22477E-02, 'ao')
mat_ss316.add_nuclide('Mo100', 2.08518E-02, 'ao')
mat_ss316.temperature = mat_temp_global
mat_ss316.set_density('atom/b-cm', 8.58870E-02)
mat_list.append(mat_ss316)
mat_air = openmc.Material(102,name="Core Air")
mat_air.add_nuclide('H1', 1.41615E+01, 'ao')
mat_air.add_nuclide('H2', 2.12456E-03, 'ao')
mat_air.add_element('C', 1.17053E-02+1.30189E-04, 'ao')
mat_air.add_nuclide('N14', 6.15481E+01, 'ao')
mat_air.add_nuclide('N15', 2.28569E-01, 'ao')
mat_air.add_nuclide('O16', 2.36230E+01+4.73602E-02, 'ao')
mat_air.add_nuclide('O17', 9.47204E-03, 'ao')
mat_air.add_nuclide('Ar36', 1.23939E-03, 'ao')
mat_air.add_nuclide('Ar38', 2.31686E-04, 'ao')
mat_air.add_nuclide('Ar40', 3.66299E-01, 'ao')
mat_air.temperature = mat_temp_global
mat_air.set_density('g/cm3', 0.5)
mat_list.append(mat_air)
## 200 - Core Materials ##
mat_fuel = openmc.Material(200,name='Fuel U-10Mo')
mat_fuel.add_element('C', 6.19354E-01+6.88872E-03,'ao')
mat_fuel.add_nuclide('Mo92', 2.49068E+00,'ao')
mat_fuel.add_nuclide('Mo94', 1.55250E+00,'ao')
mat_fuel.add_nuclide('Mo95', 2.67188E+00,'ao')
mat_fuel.add_nuclide('Mo96', 2.79947E+00,'ao')
mat_fuel.add_nuclide('Mo97', 1.60285E+00,'ao')
mat_fuel.add_nuclide('Mo98', 4.04995E+00,'ao')
mat_fuel.add_nuclide('Mo100', 1.61627E+00,'ao')
mat_fuel.add_nuclide('U234', 8.45363E-01,'ao')
mat_fuel.add_nuclide('U235', 7.69214E+01,'ao')
mat_fuel.add_nuclide('U236', 3.81533E-01,'ao')
mat_fuel.add_nuclide('U238', 4.44178E+00,'ao')
mat_fuel.temperature = mat_temp_fuel
mat_fuel.set_density('atom/b-cm', 4.96130E-02)
mat_list.append(mat_fuel)
mat_hp_na_vap = openmc.Material(201,name="Heat Pipe Core Sodium (Vapour)")
mat_hp_na_vap.add_element("Na",1)
mat_hp_na_vap.temperature = mat_temp_global
mat_hp_na_vap.set_density("kg/m3",1.7e-2)
mat_list.append(mat_hp_na_vap)
mat_hp_na_liq = openmc.Material(202,name="Heat Pipe Core Sodium (Liquid)")
mat_hp_na_liq.add_element("Na",1)
mat_hp_na_liq.temperature = mat_temp_global
mat_hp_na_liq.set_density("kg/m3",805)
mat_list.append(mat_hp_na_liq)
mat_hp_wick_unsat = openmc.Material.mix_materials(
material_id=203,
materials=[mat_ss316,mat_hp_na_vap],
fracs=[1-mat_hp_wick_porosity, mat_hp_wick_porosity],
percent_type="vo",
name="Heat Pipe Wick (Unsaturated)"
)
mat_list.append(mat_hp_wick_unsat)
mat_hp_wick_sat = openmc.Material.mix_materials(
material_id=204,
materials=[mat_ss316,mat_hp_na_liq],
fracs=[1-mat_hp_wick_porosity, mat_hp_wick_porosity],
percent_type="vo",
name="Heat Pipe Wick (Saturated)"
)
mat_list.append(mat_hp_wick_sat)
mat_beo = openmc.Material(205,name="BeO Reflector")
mat_beo.add_nuclide('Be9', 4.99528E+01,'ao')
mat_beo.add_nuclide('O16', 4.99042E+01+1.00046E-01,'ao')
mat_beo.add_nuclide('O17', 2.00099E-02,'ao')
mat_beo.add_nuclide('S32', 2.24316E-02,'ao')
mat_beo.add_nuclide('S33', 1.77054E-04,'ao')
mat_beo.add_nuclide('S34', 9.93896E-04,'ao')
mat_beo.add_nuclide('S36', 4.72141E-06,'ao')
mat_beo.temperature = mat_temp_global
mat_beo.set_density('atom/b-cm', 0.135648)
mat_beo.add_s_alpha_beta("c_Be_in_BeO")
mat_beo.add_s_alpha_beta("c_O_in_BeO")
mat_list.append(mat_beo)
mat_b4c = openmc.Material(206,name="B4C Control Rods")
mat_b4c.add_nuclide('B10',4,'ao')
mat_b4c.add_element('C',1,'ao')
mat_b4c.temperature = mat_temp_global
mat_b4c.set_density('g/cm3',2.52)
mat_list.append(mat_b4c)
materials = openmc.Materials(mat_list)
materials.export_to_xml()
############ GEOMETRY ############
geo_hp_pitch = 5.2
geo_z_abs_bot = openmc.ZPlane(z0=-10.16,boundary_type="vacuum")
geo_z_core_bot = openmc.ZPlane(z0=0.00)
geo_z_core_top = openmc.ZPlane(z0=25)
geo_z_abs_top = openmc.ZPlane(z0=35.16,boundary_type="vacuum")
geo_z_region = +geo_z_abs_bot & -geo_z_abs_top
geo_z_hp_sat = openmc.ZPlane(surface_id=416,z0=geo_z_abs_bot.z0 + cli_args.sat_height)
geo_z_hp_pool = openmc.ZPlane(surface_id=647,z0=geo_z_abs_bot.z0 + cli_args.pool_height)
## Heat Pipes ##
geo_hp_cyl = [openmc.ZCylinder(r=dia/2, x0=0.0, y0=0.0) for dia in [0.8920, 1.0920, 1.270]]
# Pattern around the core
geo_hp_steps = [math.pi*(theta+90)/180 for theta in range(0,360,45)]
# Define inner and outer regions
geo_hp_inner_regions = [openmc.ZCylinder(r=geo_hp_cyl[0].r,
x0=geo_hp_pitch*math.cos(theta),
y0=geo_hp_pitch*math.sin(theta)
) for theta in geo_hp_steps]
geo_hp_wick_regions = [openmc.ZCylinder(r=geo_hp_cyl[1].r,
x0=geo_hp_pitch*math.cos(theta),
y0=geo_hp_pitch*math.sin(theta)
) for theta in geo_hp_steps]
geo_hp_outer_regions = [openmc.ZCylinder(r=geo_hp_cyl[2].r,
x0=geo_hp_pitch*math.cos(theta),
y0=geo_hp_pitch*math.sin(theta)
) for theta in geo_hp_steps]
geo_hp_outer_union = openmc.Union(-reg for reg in geo_hp_outer_regions)
# Fill cells for each pipe
geo_hp_inner_liq_cells = [openmc.Cell(name=f"Heat Pipe {num} Liquid Inner Cell",region=-reg&+geo_z_abs_bot&-geo_z_hp_pool,fill=mat_hp_na_liq) for num,reg in enumerate(geo_hp_inner_regions)]
geo_hp_inner_vap_cells = [openmc.Cell(name=f"Heat Pipe {num} Vapour Inner Cell",region=-reg&+geo_z_hp_pool&-geo_z_abs_top,fill=mat_hp_na_vap) for num,reg in enumerate(geo_hp_inner_regions)]
geo_hp_wick_unsat_cells = [openmc.Cell(name=f"Heat Pipe {num} Unsaturated Wick Cell",region=-reg_out&+reg_in&+geo_z_hp_sat&-geo_z_abs_top,fill=mat_hp_wick_unsat)
for num,(reg_out,reg_in) in enumerate(zip(geo_hp_wick_regions,geo_hp_inner_regions))]
geo_hp_wick_sat_cells = [openmc.Cell(name=f"Heat Pipe {num} Saturated Wick Cell",region=-reg_out&+reg_in&-geo_z_hp_sat&+geo_z_abs_bot,fill=mat_hp_wick_sat)
for num,(reg_out,reg_in) in enumerate(zip(geo_hp_wick_regions,geo_hp_inner_regions))]
geo_hp_outer_cells = [openmc.Cell(name=f"Heat Pipe {num} Outer Cell",region=-reg_out&+reg_in&geo_z_region,fill=mat_haynes230)
for num,(reg_out,reg_in) in enumerate(zip(geo_hp_outer_regions,geo_hp_wick_regions))]
## Core Air Cylinder ##
geo_air_inner_cyl = openmc.ZCylinder(r=1.9939, x0=0.0, y0=0.0)
geo_air_inner_region = +geo_z_core_bot & -geo_z_abs_top & -geo_air_inner_cyl
geo_air_inner_cell = openmc.Cell(name="Inner Air Cell",region=geo_air_inner_region,fill=mat_air)
## Core Fuel Block ##
geo_fuel_cyl = openmc.ZCylinder(r=5.4991, x0=0.0, y0=0.0)
geo_fuel_region = +geo_z_core_bot & -geo_z_core_top & -geo_fuel_cyl & +geo_air_inner_cyl & ~geo_hp_outer_union
geo_fuel_cell = openmc.Cell(name="Core Fuel Cell",region=geo_fuel_region,fill=mat_fuel)
## BeO Reflectors ##
# Lower Reflector
geo_refl_lower_region = +geo_z_abs_bot & -geo_z_core_bot & -geo_fuel_cyl & ~geo_hp_outer_union
geo_refl_lower_cell = openmc.Cell(name="Lower BeO Reflector Cell",region=geo_refl_lower_region,fill=mat_beo)
# Upper Reflector
geo_refl_upper_region = +geo_z_core_top & -geo_z_abs_top & +geo_air_inner_cyl & -geo_fuel_cyl & ~geo_hp_outer_union
geo_refl_upper_cell = openmc.Cell(name="Upper BeO Reflector Cell",region=geo_refl_upper_region,fill=mat_beo)
## Radial Core Surroundings ##
geo_rad_cyl = [openmc.ZCylinder(r=dia/2, x0=0.0, y0=0.0) for dia in [12.70, 13.30, 14.11, 38.40]]
geo_rad_cyl[-1].boundary_type="vacuum"
geo_rad_cells = [openmc.Cell(name="Intermediate Air Cell",region=+geo_fuel_cyl&-geo_rad_cyl[0]&geo_z_region&~geo_hp_outer_union,fill=mat_air),
openmc.Cell(name="Steel Annulus Cell",region=+geo_rad_cyl[0]&-geo_rad_cyl[1]&geo_z_region,fill=mat_ss316),
openmc.Cell(name="Outer Air Cell",region=+geo_rad_cyl[1]&-geo_rad_cyl[2]&geo_z_region,fill=mat_air),
openmc.Cell(name="Outer BeO Reflector Cell",region=+geo_rad_cyl[2]&-geo_rad_cyl[3]&geo_z_region,fill=mat_beo)]
geo_root_universe = openmc.Universe(name="Root Universe",cells=[geo_fuel_cell,geo_air_inner_cell,geo_refl_upper_cell,geo_refl_lower_cell]+geo_rad_cells+geo_hp_inner_liq_cells+geo_hp_inner_vap_cells+geo_hp_wick_unsat_cells+geo_hp_wick_sat_cells+geo_hp_outer_cells)
geo_obj = openmc.Geometry(geo_root_universe)
geo_obj.export_to_xml()
## Settings ##
set_obj = openmc.Settings()
set_obj.particles = 20000
set_obj.batches = 4500
set_obj.inactive = 500
set_obj.temperature = {"method": "interpolation"}
set_src = openmc.IndependentSource()
set_src.space = openmc.stats.Point((0.0,0.0,30.0))
set_src.space = openmc.stats.CylindricalIndependent(
r = openmc.stats.Uniform(geo_air_inner_cyl.r,geo_fuel_cyl.r),
z = openmc.stats.Uniform(geo_z_core_bot.z0,geo_z_core_top.z0),
phi = openmc.stats.Uniform(0.0,2*math.pi),
origin = (0.0,0.0,0.0)
)
#set_obj.verbosity=10
set_obj.export_to_xml()
# Run!
openmc.run() if cli_args.run else None
|