Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6ee0279

Browse files
committedDec 3, 2024
add tally to c5g7, set up smr-mg
1 parent c503948 commit 6ee0279

File tree

7 files changed

+3828
-32
lines changed

7 files changed

+3828
-32
lines changed
 

‎05-C5G7-original/part1/input.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import numpy as np
2-
import h5py, mcdc
2+
import h5py, mcdc, math
33

44
# =============================================================================
55
# Materials
@@ -284,8 +284,24 @@ def set_mat(mat):
284284
# Set tally, setting, and run mcdc
285285
# =============================================================================
286286

287+
# Tally
288+
mcdc.tally.mesh_tally(
289+
scores=["flux"],
290+
x=np.linspace(0.0, pitch * 17 * 3, 17 * 3 + 1),
291+
y=np.linspace(-pitch * 17 * 3, 0.0, 17 * 3 + 1),
292+
z=np.linspace(-(core_height / 2 + reflector_thickness), (core_height / 2 + reflector_thickness), int(math.ceil((core_height + 2.0 * reflector_thickness) / pitch)) + 1),
293+
g=np.array([-0.5, 4.5, 6.5])
294+
)
295+
mcdc.tally.mesh_tally(
296+
scores=["fission"],
297+
x=np.linspace(0.0, pitch * 17 * 2, 17 * 2 + 1),
298+
y=np.linspace(-pitch * 17 * 2, 0.0, 17 * 2 + 1),
299+
z=np.linspace(-(core_height / 2), (core_height / 2), int(math.ceil(core_height / pitch)) + 1),
300+
)
301+
287302
# Setting
288-
mcdc.setting(N_particle=1e5)
303+
#mcdc.setting(N_particle=1e5)
304+
mcdc.setting(N_particle=1e3)
289305
mcdc.eigenmode(N_inactive=50, N_active=150, gyration_radius="all", save_particle=True)
290306
mcdc.population_control()
291307

‎08-SMR_MG-4_phase/kinetic/input.py

Lines changed: 943 additions & 0 deletions
Large diffs are not rendered by default.

‎08-SMR_MG-4_phase/static-phase1/input.py

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,51 @@
99
lib = h5py.File("../../data/MGXS-C5G7.h5", "r")
1010

1111
# Setter
12-
def set_mat(mat):
12+
def set_mat(mat, frac):
13+
capture = mat[0]['capture'][:] * frac[0]
14+
scatter = mat[0]['scatter'][:] * frac[0]
15+
fission = mat[0]['fission'][:] * frac[0]
16+
nu_p = mat[0]['nu_p'][:] * frac[0]
17+
nu_d = mat[0]['nu_d'][:] * frac[0]
18+
chi_p = mat[0]['chi_p'][:] * frac[0]
19+
chi_d = mat[0]['chi_d'][:] * frac[0]
20+
speed = mat[0]['speed'][:] * frac[0]
21+
decay = mat[0]['decay'][:] * frac[0]
22+
for i in range(1, len(mat)):
23+
capture += mat[i]['capture'][:] * frac[i]
24+
scatter += mat[i]['scatter'][:] * frac[i]
25+
fission += mat[i]['fission'][:] * frac[i]
26+
nu_p += mat[i]['nu_p'][:] * frac[i]
27+
nu_d += mat[i]['nu_d'][:] * frac[i]
28+
chi_p += mat[i]['chi_p'][:] * frac[i]
29+
chi_d += mat[i]['chi_d'][:] * frac[i]
30+
speed += mat[i]['speed'][:] * frac[i]
31+
decay += mat[i]['decay'][:] * frac[i]
1332
return mcdc.material(
14-
capture=mat["capture"][:],
15-
scatter=mat["scatter"][:],
16-
fission=mat["fission"][:],
17-
nu_p=mat["nu_p"][:],
18-
nu_d=mat["nu_d"][:],
19-
chi_p=mat["chi_p"][:],
20-
chi_d=mat["chi_d"][:],
21-
speed=mat["speed"],
22-
decay=mat["decay"],
33+
capture=capture,
34+
scatter=scatter,
35+
fission=fission,
36+
nu_p=nu_p,
37+
nu_d=nu_d,
38+
chi_p=chi_p,
39+
chi_d=chi_d,
40+
speed=speed,
41+
decay=decay,
2342
)
2443

2544
# Materials
26-
m_helium = set_mat(lib["gt"])
27-
m_inconel = set_mat(lib["gt"])
28-
m_ss302 = set_mat(lib["gt"])
29-
m_ss304 = set_mat(lib["gt"])
30-
m_csteel = set_mat(lib["gt"])
31-
m_zr4 = set_mat(lib["gt"])
32-
m_m5 = set_mat(lib["gt"])
33-
m_water = set_mat(lib["mod"])
34-
m_fuel31 = set_mat(lib["mox87"])
35-
m_fuel24 = set_mat(lib["mox7"])
36-
m_fuel16 = set_mat(lib["mox43"])
37-
m_cr = set_mat(lib["cr"])
45+
m_helium = set_mat([lib["gt"]], [1.0])
46+
m_inconel = set_mat([lib["gt"]], [1.0])
47+
m_ss302 = set_mat([lib["gt"]], [1.0])
48+
m_ss304 = set_mat([lib["gt"]], [1.0])
49+
m_csteel = set_mat([lib["gt"]], [1.0])
50+
m_zr4 = set_mat([lib["gt"]], [1.0])
51+
m_m5 = set_mat([lib["gt"]], [1.0])
52+
m_water = set_mat([lib["mod"], lib['cr']], [0.97, 0.03])
53+
m_fuel31 = set_mat([lib["uo2"]], [1.0])
54+
m_fuel24 = set_mat([lib["mox87"]], [1.0])
55+
m_fuel16 = set_mat([lib["mox43"]], [1.0])
56+
m_cr = set_mat([lib["cr"]], [2.0])
3857

3958
# ======================================================================================
4059
# Geometry
@@ -152,11 +171,11 @@ def set_mat(mat):
152171

153172
# Problem spec.
154173
config['time'] = 0.0
155-
config['frac_r'] = 0.0
156-
config['frac_rx'] = 0.0
157-
config['frac_s'] = 0.0
158-
config['frac_sx2'] = 0.0
159-
config['frac_sx3'] = 0.0
174+
config['frac_r'] = 1.0
175+
config['frac_rx'] = 1.0
176+
config['frac_s'] = 1.0
177+
config['frac_sx2'] = 0.65
178+
config['frac_sx3'] = 1.0
160179
cases = ['r', 'rx', 's', 'sx2', 'sx3']
161180

162181
# All cases
@@ -893,7 +912,7 @@ def set_mat(mat):
893912
# =============================================================================
894913

895914
# Setting
896-
mcdc.setting(N_particle=1e3)
915+
mcdc.setting(N_particle=1e5)
897916
mcdc.eigenmode(N_inactive=50, N_active=150, gyration_radius="all")
898917
mcdc.population_control()
899918

There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.