krakentools.groupconstants.genpoly.records.materials.SelectMaterial¶
- class krakentools.groupconstants.genpoly.records.materials.SelectMaterial(parent, cr_key, spa_key, det_key, pu_corr_mdep_idx=1, mdep_data=None, axial_dfs=False)¶
Bases:
object
A class representing a single homogenized material with a distinct CR, SPA and DET value. Contains data for nominal diffusion parameters and their polynomial coefficients at different burnups
- __init__(parent, cr_key, spa_key, det_key, pu_corr_mdep_idx=1, mdep_data=None, axial_dfs=False)¶
Methods
__init__
(parent, cr_key, spa_key, det_key[, ...])add_data
(node_branches)Adds Serpent result data to this material
construct_plutonium_burn_matrix
(burnup, ...)- rtype:
ndarray
evaluate_at
(group_constant, burnup, ...[, ...])Evaluates the value of group_constant for this SelectMaterial at some point of the parametrization space.
evaluate_k_at
(burnup, momentary_point[, ...])Evaluates the infinite k-eigenvalue for this SelectMaterial at some point of the parametrization space.
get_coefs_at
(group_constant, burnup[, ...])- rtype:
ndarray
get_k_coefs_at
(group_constant, burnup, ...)- rtype:
ndarray
get_k_nominal_at
(group_constant, burnup)- rtype:
ndarray
get_nominal_at
(group_constant, burnup[, ...])- rtype:
ndarray
microdeplete_plutonium
([sub_steps, ...])- rtype:
None
parametrize_coef
(gc_type, dc_type, version, ...)Evaluates polynomial coefficients for DiffusionParameters for each burnup.
parametrize_history
(gc_type, dc_type, ...)Evaluates plutonium history k-coefficients for DiffusionParameters for each burnup.
parametrize_nominal
(gc_type, dc_type, ...[, ...])Obtains nominal group constant data for each burnup.
parametrize_zero_coef
(fit[, off_nom_his])Sets polynomial coefficients for DiffusionParameters to zero for each burnup.
preprocess_data
(nominal_fit_vars, ...)Preprocesses the linked NodeBranch data into a structure that can be easily used in the parametrization.
write_fb_scale
(nom_point, fout, txt_width)- rtype:
None
write_gc_coe_val
(group_constant, idx, fout, ...)Writes polynomial coefficient values for requested group constant to file.
write_gc_nom_val
(group_constant, idx, fout, ...)Writes nominal values for requested group constant to file.
write_name
(fout)- rtype:
None
- add_data(node_branches)¶
Adds Serpent result data to this material
- Parameters:
node_branches (List[NodeBranch]) – List of NodeBranch objects to add to this material.
- Return type:
None
- evaluate_at(group_constant, burnup, momentary_point, pu_ratio=1.0, raise_errors=True)¶
Evaluates the value of group_constant for this SelectMaterial at some point of the parametrization space.
- Parameters:
group_constant (GroupConstants) – The group constant whose value to evaluate.
momentary_point (np.ndarray) – Momentary values of the fit variables for the evaluation.
pu_ratio (float, optional) – Ratio of Pu239_current/Pu239_nominal. Used to evaluate the history effects. Defaults to 1.0 (nominal history).
raise_errors (bool, optional) – Raise errors as exceptions? False will simply print out them as warnings. Defaults to True.
- Returns:
- The value(s) of the group constants at the point of
evaluation.
- Return type:
np.ndarray
- evaluate_k_at(burnup, momentary_point, pu_ratio=1.0)¶
Evaluates the infinite k-eigenvalue for this SelectMaterial at some point of the parametrization space.
- Parameters:
momentary_point (np.ndarray) – Momentary values of the fit variables for the evaluation.
pu_ratio (float, optional) – Ratio of Pu239_current/Pu239_nominal. Used to evaluate the history effects. Defaults to 1.0 (nominal history).
- Returns:
Infinite k-eigenvalue.
- Return type:
float
- parametrize_coef(gc_type, dc_type, version, fit_inverse_of_D, fit, off_nom_his=False, k_coefs=False)¶
Evaluates polynomial coefficients for DiffusionParameters for each burnup.
- Return type:
None
- parametrize_history(gc_type, dc_type, version, fit)¶
Evaluates plutonium history k-coefficients for DiffusionParameters for each burnup.
- Return type:
None
- parametrize_nominal(gc_type, dc_type, version, fit_inverse_of_D, off_nom_his=False)¶
Obtains nominal group constant data for each burnup.
- Return type:
None
- parametrize_zero_coef(fit, off_nom_his=False)¶
Sets polynomial coefficients for DiffusionParameters to zero for each burnup.
- Return type:
None
- preprocess_data(nominal_fit_vars, nominal_his_vars, nominal_his_selects)¶
Preprocesses the linked NodeBranch data into a structure that can be easily used in the parametrization. Figures out which NodeBranch corresponds to nominal and which to coefficient calculation, stores them according to burnup etc.
- Parameters:
nominal_fit_vars (np.ndarray [shape = len(FitVars)]) – Nominal values for fit variables. These are used to identify the nominal points from variations.
nominal_his_vars (np.ndarray [shape = len(FitVars)]) – Nominal values for historical variables. These are used to identify the nominal history data from off-nominal history.
nominal_his_selects (List[str]) – Nominal historical values for the select variables. Used to identify the nominal history data from the off-nominal.
- Return type:
None
- write_gc_coe_val(group_constant, idx, fout, precision, k_coef=False, cutoff=1e-99)¶
Writes polynomial coefficient values for requested group constant to file.
- Parameters:
group_constant (GroupConstants) – Group constant to write.
idx (int) – Index (sum index of group, surface, pin, etc. etc.).
fout (TextIO) – File to write to.
precision (int) – The number of decimal places to include.
k_coef (bool, optional) – Write values for plutonium coefficients of GC instead of GC. Defaults to False.
cutoff (float) – Round coefficient values smaller than this to 0.0 (in case of negligible dependence different versions of numpy give slightly different negligible coefficients which makes regression testing difficult)
- Return type:
None
- write_gc_nom_val(group_constant, idx, fout, precision, k_coef=False, write_name=True)¶
Writes nominal values for requested group constant to file.
- Parameters:
group_constant (GroupConstants) – Group constant to write.
idx (int) – Index (sum index of group, surface, pin, etc. etc.).
fout (TextIO) – File to write to.
precision (int) – The number of decimal places to include.
k_coef (bool, optional) – Write values for plutonium coefficients of GC instead of GC. Defaults to False.
write_name (bool, optional) – Write “name” of select material in the beginning of the line (cr_idx, spa_idx, det_idx). Defaults to True.
- Return type:
None