Skip to content

Commit 7d38e63

Browse files
Merge pull request #3 from LIBRA-project/neutronics-model
Neutronics model
2 parents d1eb38c + 315d949 commit 7d38e63

File tree

8 files changed

+1630
-16
lines changed

8 files changed

+1630
-16
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ jobs:
1515
with:
1616
auto-update-conda: true
1717
environment-file: environment.yml
18-
activate-environment: libra-run-env
18+
activate-environment: baby_1l_run_1
19+
20+
- name: Run neutronics model
21+
shell: bash -l {0}
22+
working-directory: analysis/neutron
23+
run: |
24+
python openmc_model.py
25+
jupyter-nbconvert --to notebook postprocessing.ipynb --execute
1926
2027
- name: Run tritium model
2128
shell: bash -l {0}

analysis/neutron/helpers.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import math
2+
import openmc
3+
4+
5+
def get_exp_cllif_density(temp, LiCl_frac=0.695):
6+
"""Calculates density of ClLiF [g/cc] from temperature in Celsius
7+
and molar concentration of LiCl. Valid for 660 C - 1000 C.
8+
Source:
9+
G. J. Janz, R. P. T. Tomkins, C. B. Allen;
10+
Molten Salts: Volume 4, Part 4
11+
Mixed Halide Melts Electrical Conductance, Density, Viscosity, and Surface Tension Data.
12+
J. Phys. Chem. Ref. Data 1 January 1979; 8 (1): 125–302.
13+
https://doi.org/10.1063/1.555590
14+
"""
15+
temp = temp + 273.15 # Convert temperature from Celsius to Kelvin
16+
C = LiCl_frac * 100 # Convert molar concentration to molar percent
17+
18+
a = 2.25621
19+
b = -8.20475e-3
20+
c = -4.09235e-4
21+
d = 6.37250e-5
22+
e = -2.52846e-7
23+
f = 8.73570e-9
24+
g = -5.11184e-10
25+
26+
rho = a + b * C + c * temp + d * C**2 + e * C**3 + f * temp * C**2 + g * C * temp**2
27+
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

0 commit comments

Comments
 (0)