Skip to content

Commit

Permalink
small fission source type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
spasmann committed Nov 9, 2023
1 parent 0a523b5 commit f190d9f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions mcdc/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2803,6 +2803,8 @@ def iqmc_update_source(mcdc):
and mcdc["technique"]["iqmc"]["eigenmode_solver"] == "power_iteration"
):
fission = mcdc["technique"]["iqmc"]["score"]["effective-fission-outter"]
# normalize fission source
# fission /= fission.sum()
else:
fission = mcdc["technique"]["iqmc"]["score"]["effective-fission"]
mcdc["technique"]["iqmc"]["source"] = scatter + (fission / keff) + fixed
Expand Down
3 changes: 2 additions & 1 deletion mcdc/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ def power_iteration(mcdc):
kernel.iqmc_generate_material_idx(mcdc)
if mcdc["technique"]["iqmc"]["source"].all() == 0.0:
kernel.iqmc_prepare_source(mcdc)
kernel.iqmc_update_source(mcdc)

if mcdc["technique"]["iqmc"]["score"]["fission-source"].all() == 0.0:
kernel.iqmc_prepare_nuSigmaF(mcdc)
Expand All @@ -553,7 +554,7 @@ def power_iteration(mcdc):
mcdc["technique"]["iqmc"]["itt"] = 0

# update k_eff
mcdc["k_eff"] *= score_bin["fission-source"] / fission_source_old
mcdc["k_eff"] *= score_bin["fission-source"][0] / fission_source_old[0]

# calculate diff in keff
mcdc["technique"]["iqmc"]["res_outter"] = abs(mcdc["k_eff"] - k_old) / k_old
Expand Down
2 changes: 1 addition & 1 deletion mcdc/type_.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def make_type_technique(N_particle, G, card):
if not card["iqmc"]["score_list"][name]:
shape = (0,) * len(shape)
scores_struct += [(name, float64, shape)]
# TODO: make outter flux/effective fission size zero if not eigenmode
# TODO: make outter effective fission size zero if not eigenmode
# (causes problems with numba)
scores_struct += [("effective-fission-outter", float64, (Ng, Nt, Nx, Ny, Nz))]
scores = np.dtype(scores_struct)
Expand Down

0 comments on commit f190d9f

Please sign in to comment.