Skip to content

Commit c18e9b0

Browse files
Merge pull request #20 from LIBRA-project/simplify-neutronics
removed unneeded stuff
2 parents 5fd0862 + 210bb5a commit c18e9b0

File tree

6 files changed

+7
-842
lines changed

6 files changed

+7
-842
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
- name: Run neutronics
2626
shell: bash -l {0}
2727
working-directory: analysis/neutron
28-
run: python openmc_model.py
28+
run: |
29+
python openmc_model.py
30+
jupyter-nbconvert --to notebook postprocessing.ipynb --execute
2931
3032
- name: Run tritium model
3133
shell: bash -l {0}

analysis/neutron/.gitkeep

Whitespace-only changes.

analysis/neutron/helpers.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,3 @@ def get_exp_cllif_density(temp, LiCl_frac=0.695):
2626
rho = a + b * C + c * temp + d * C**2 + e * C**3 + f * temp * C**2 + g * C * temp**2
2727

2828
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

analysis/neutron/openmc_model.py

Lines changed: 2 additions & 2 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

@@ -519,4 +519,4 @@ def baby_model():
519519
with open(processed_data_file, "w") as f:
520520
json.dump(existing_data, f, indent=4)
521521

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

analysis/neutron/postprocessing.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
},
196196
{
197197
"cell_type": "code",
198-
"execution_count": 3,
198+
"execution_count": null,
199199
"metadata": {},
200200
"outputs": [
201201
{
@@ -212,7 +212,7 @@
212212
"source": [
213213
"# Visualization\n",
214214
"\n",
215-
"from vault import Air\n",
215+
"from libra_toolbox.neutronics.vault import Air\n",
216216
"from openmc_model import air\n",
217217
"\n",
218218
"x_c = 587\n",

0 commit comments

Comments
 (0)