Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing capabilities on continuous energy mode #150

Merged
merged 10 commits into from
Jan 30, 2024
2 changes: 1 addition & 1 deletion mcdc/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def reset(self):
"ww_mesh": make_card_mesh(),
"weight_roulette": False,
"wr_threshold": 0.0,
"wr_chance": 1.0,
"wr_survive": 1.0,
"iQMC": False,
"iqmc": {
"generator": "sobol",
Expand Down
11 changes: 8 additions & 3 deletions mcdc/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
XS_SCATTER = 1
XS_CAPTURE = 2
XS_FISSION = 3
NU_TOTAL = 0
NU_PROMPT = 1
NU_DELAYED = 2
XS_NU_FISSION = 4
XS_NU_FISSION_PROMPT = 5
XS_NU_FISSION_DELAYED = 6
XS_NU_SCATTER = 7

NU_FISSION = 0
NU_FISSION_PROMPT = 1
NU_FISSION_DELAYED = 2
17 changes: 8 additions & 9 deletions mcdc/input_.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,17 +1303,16 @@ def iQMC(
card["iqmc"]["krylov_restart"] = krylov_restart


def weight_roulette(chance, wr_threshold):
def weight_roulette(w_threshold=0.2, w_survive=1.0):
"""
If neutron weight is below wr_threshold, then enter weight rouelette
technique. Neutron has 'chance' probability of having its weight increased
by factor of 1/CHANCE, and 1-CHANCE probability of terminating.
If neutron weight is below `w_threshold`, then enter weight rouelette
technique with survival weight `w_survive`.

Parameters
----------
chance : probability of survival
wr_threshold : weight_roulette() is called on a particle
if P['w'] <= wr_threshold
w_threshold : weight_roulette() is called on a particle if
P['w'] <= wr_threshold
w_survive : weight survival

Returns
-------
Expand All @@ -1322,8 +1321,8 @@ def weight_roulette(chance, wr_threshold):
"""
card = mcdc.input_deck.technique
card["weight_roulette"] = True
card["wr_chance"] = chance
card["wr_threshold"] = wr_threshold
card["wr_threshold"] = w_threshold
card["wr_survive"] = w_survive


def IC_generator(
Expand Down
Loading
Loading