Skip to content

Commit 1bcc7ad

Browse files
Merge pull request #14 from davidepettinari/support
Add HDPE source supports
2 parents eb2e560 + 95a2b46 commit 1bcc7ad

File tree

5 files changed

+54
-1002
lines changed

5 files changed

+54
-1002
lines changed

analysis/neutron/helpers.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,4 @@ def get_exp_cllif_density(temp, LiCl_frac=0.695):
2525

2626
rho = a + b * C + c * temp + d * C**2 + e * C**3 + f * temp * C**2 + g * C * temp**2
2727

28-
return rho
29-
30-
31-
def calculate_cylinder_volume(radius, height):
32-
volume = math.pi * radius**2 * height
33-
return volume
34-
35-
36-
def translate_surface(
37-
surface: (
38-
openmc.XPlane | openmc.YPlane | openmc.ZPlane | openmc.Plane | openmc.Sphere
39-
),
40-
dx: float,
41-
dy: float,
42-
dz: float,
43-
) -> openmc.Surface:
44-
"""Translate an OpenMC surface by dx, dy, dz."""
45-
if isinstance(surface, openmc.XPlane):
46-
surface.x0 += dx
47-
elif isinstance(surface, openmc.YPlane):
48-
surface.y0 += dy
49-
elif isinstance(surface, openmc.ZPlane):
50-
surface.z0 += dz
51-
elif isinstance(surface, openmc.Plane):
52-
surface.d += surface.a * dx + surface.b * dy + surface.c * dz
53-
elif isinstance(surface, openmc.Sphere):
54-
surface.x0 += dx
55-
surface.y0 += dy
56-
surface.z0 += dz
57-
else:
58-
raise TypeError(f"Unsupported surface type: {type(surface)}")
59-
return surface
28+
return rho

analysis/neutron/openmc_model.py

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import openmc
2-
import vault
32
from libra_toolbox.neutronics.neutron_source import A325_generator_diamond
3+
from libra_toolbox.neutronics import vault
44
import helpers
55

66

@@ -167,15 +167,15 @@ def baby_geometry(x_c: float, y_c: float, z_c: float):
167167
sphere = openmc.Sphere(x0=x_c, y0=y_c, z0=z_c, r=50.00) # before r=50.00
168168

169169
######## Lead bricks positioned under the source #################
170-
positions = [
170+
lead_positions = [
171171
(x_c - 13.50, y_c, z_c - z_tab),
172-
(x_c - 4.50, y_c, z_c - z_tab),
172+
(x_c - 2.96, y_c, z_c - z_tab),
173173
(x_c + 36.50, y_c, z_c - z_tab),
174-
(x_c + 27.50, y_c, z_c - z_tab),
174+
(x_c + 25.96, y_c, z_c - z_tab),
175175
]
176176

177177
lead_blocks = []
178-
for position in positions:
178+
for position in lead_positions:
179179
lead_block_region = openmc.model.RectangularParallelepiped(
180180
position[0] - lead_width / 2,
181181
position[0] + lead_width / 2,
@@ -186,6 +186,25 @@ def baby_geometry(x_c: float, y_c: float, z_c: float):
186186
)
187187
lead_blocks.append(lead_block_region)
188188

189+
src_supp_length = 40.00
190+
src_supp_height = 20.00
191+
src_supp_width = 2.54
192+
src_supp_position = [
193+
(x_c - 13.50 + lead_width / 2, y_c, z_c - z_tab),
194+
(x_c + 25.96 + lead_width / 2, y_c, z_c - z_tab),
195+
]
196+
src_supports = []
197+
for position in src_supp_position:
198+
source_support = openmc.model.RectangularParallelepiped(
199+
position[0],
200+
position[0] + src_supp_width,
201+
position[1] - src_supp_length / 2,
202+
position[1] + src_supp_length / 2,
203+
position[2],
204+
position[2] + src_supp_height,
205+
)
206+
src_supports.append(source_support)
207+
189208
# regions
190209
source_wall_region = -ext_cyl_source & +source_region
191210
source_region = -source_region
@@ -209,6 +228,8 @@ def baby_geometry(x_c: float, y_c: float, z_c: float):
209228
lead_block_2_region = -lead_blocks[1]
210229
lead_block_3_region = -lead_blocks[2]
211230
lead_block_4_region = -lead_blocks[3]
231+
src_supp_1_region = -src_supports[0] & ~source_wall_region & ~source_region
232+
src_supp_2_region = -src_supports[1] & ~source_wall_region & ~source_region
212233
he_region = (
213234
+z_plane_5
214235
& -z_plane_12
@@ -228,6 +249,8 @@ def baby_geometry(x_c: float, y_c: float, z_c: float):
228249
& ~lead_block_2_region
229250
& ~lead_block_3_region
230251
& ~lead_block_4_region
252+
& ~src_supp_1_region
253+
& ~src_supp_2_region
231254
)
232255
sphere_region = (
233256
-sphere
@@ -248,6 +271,8 @@ def baby_geometry(x_c: float, y_c: float, z_c: float):
248271
& ~lead_block_2_region
249272
& ~lead_block_3_region
250273
& ~lead_block_4_region
274+
& ~src_supp_1_region
275+
& ~src_supp_2_region
251276
)
252277

253278
# cells
@@ -287,6 +312,10 @@ def baby_geometry(x_c: float, y_c: float, z_c: float):
287312
lead_block_3_cell.fill = lead
288313
lead_block_4_cell = openmc.Cell(region=lead_block_4_region)
289314
lead_block_4_cell.fill = lead
315+
src_supp_1_cell = openmc.Cell(region=src_supp_1_region)
316+
src_supp_1_cell.fill = HDPE
317+
src_supp_2_cell = openmc.Cell(region=src_supp_2_region)
318+
src_supp_2_cell.fill = HDPE
290319

291320
cells = [
292321
source_wall_cell_1,
@@ -307,6 +336,8 @@ def baby_geometry(x_c: float, y_c: float, z_c: float):
307336
lead_block_2_cell,
308337
lead_block_3_cell,
309338
lead_block_4_cell,
339+
src_supp_1_cell,
340+
src_supp_2_cell,
310341
]
311342

312343
return sphere, cllif_cell, cells
@@ -330,6 +361,7 @@ def baby_model():
330361
air,
331362
epoxy,
332363
he,
364+
HDPE,
333365
]
334366

335367
# BABY coordinates
@@ -486,6 +518,12 @@ def baby_model():
486518
lead.add_nuclide("Pb207", 0.221, "ao")
487519
lead.add_nuclide("Pb208", 0.524, "ao")
488520

521+
# High Density Polyethylene
522+
# Reference: PNNL Report 15870 (Rev. 1)
523+
HDPE = openmc.Material(name="HDPE")
524+
HDPE.set_density("g/cm3", 0.95)
525+
HDPE.add_element("H", 0.143724, "wo")
526+
HDPE.add_element("C", 0.856276, "wo")
489527

490528
if __name__ == "__main__":
491529
model = baby_model()
@@ -519,4 +557,4 @@ def baby_model():
519557
with open(processed_data_file, "w") as f:
520558
json.dump(existing_data, f, indent=4)
521559

522-
print(f"Processed data stored in {processed_data_file}")
560+
print(f"Processed data stored in {processed_data_file}")

analysis/neutron/postprocessing.ipynb

Lines changed: 8 additions & 158 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)