krakentools.CoreLattice.CoreLattice

class krakentools.CoreLattice.CoreLattice

Bases: object

A class representing a two-dimensional reactor core lattice. Handles many things for radial reflector group constant generation.

__init__()

Methods

__init__()

build_model(core_lattice_string, ...[, ...])

Parses input string data to reasonable numerical values or string arrays.

calculate_reflector_dfs_from_data([corrected])

Evaluates radial reflector discontinuity factors based on heterogeneous

get_radial_reflector_relevant_nodes()

Returns a list of nodes that needs to be processed for radial reflector

link_inf_lattice_data(node_branch_dict[, ...])

Links infinite lattice NodeBranch data to nodes from a dictionary.

link_radial_reflector_data(node_branch_list)

Links NodeBranch data from list to the relevant nodes in the reflector region.

solve_ants_nodes([folder, n_proc, ...])

Runs Ants single node calculations for reflector and core boundary fuel nodes.

write_gen_poly(fname, nominal_point[, fit, ...])

Parametrizes the reflector data according to the generic polynomial format and writes it to a file.

write_h_trc_input([folder, fname, ...])

Writes Serpent input for generating hydrogen TRC curves.

write_serpent_radial_reflector_files([folder])

Writes files required to set up ADF and GC calculation for current core lattice.

build_model(core_lattice_string, core_loading_string, core_empty_pos_names_string_array, core_symmetry_string, subdiv_xy=1, zmin=-1e+37, zmax=1e+37, print_symmetry_mapping=False)

Parses input string data to reasonable numerical values or string arrays.

Parameters:
  • core_lattice_string (str) – lat-card from Serpent input describing the core lattice.

  • core_loading_string (str) – A string representing the core (fueled) loading. Can be copy pasted directly from Serpent as a multiline string terminated with triple-quotes.

  • core_empty_pos_names_string_array (List[str]) – List of strings indicating non-fueled position in the core loading.

  • core_symmetry_string (str) – Symmetry string from Serpent input for the core universe or an empty string.

  • subdiv_xy (int, optional) – How many subnodes to divide the nodes into (2 gives 2x2 subdivision). Defaults to 1.

  • zmin (float, optional) – Axial lower limit for the Serpent model. Defaults to -INFTY.

  • zmax (float, optional) – Axial upper limit for the Serpent model. Defaults to INFTY.

  • print_symmetry_mapping (bool, optional) – Should the symmetry mapping be printed to a file for debugging. Defaults to False.

Return type:

None

calculate_reflector_dfs_from_data(corrected=True)
Evaluates radial reflector discontinuity factors based on heterogeneous

and homogeneous fluxes

Parameters:

corrected (bool, optional) – Correct the rDF with ADF? Defaults to True.

Return type:

None

get_radial_reflector_relevant_nodes()
Returns a list of nodes that needs to be processed for radial reflector

homogenization calculations. List includes reflector nodes and the outermost fuel nodes.

Return type:

List[Node]

Returns:

List[Node] –

List of Nodes.

Links infinite lattice NodeBranch data to nodes from a dictionary.

Parameters:

node_branch_dict (Dict[str, List[NodeBranch]]) – Dictionary containing Lists of NodeBranches with assembly type / node type as the key, e.g. “B20”. The NodeBranch lists will be linked to nodes in this CoreLattice based on the name

Return type:

None

Links NodeBranch data from list to the relevant nodes in the reflector region.

Parameters:
  • node_branch_list (List[NodeBranch]) – List of NodeBranches to link.

  • symmetricize (bool, optional) – Calculate averages based on core symmetry string. Defaults to True.

Return type:

None

solve_ants_nodes(folder='./Ants2D/', n_proc=1, n_iter_max=1000, dc_type=DCTypes.TRC, plot_homo_flux=False, critical_node_method=AntsCriticalNodes.MODE_FLUX_LIMIT, eigenvalue_critical_limit=5e-07, eigenvalue_real_limit=1e-13)

Runs Ants single node calculations for reflector and core boundary fuel nodes. Collects the homogeneous surface fluxes from Ants. Uses Cerberus and a single Ants instance.

Parameters:

Ants. (all_nodes {Sequence[Node]} -- The nodes to solve with) –

Keyword Arguments:
  • run. (n_iter_max {int} -- Maximum number of Ants outer iterations to) – Will be created if it does not exist. (default: {“./Ants2D/”})

  • solutions. (n_proc {int} -- Number of parallel processes to use for Ants) – (default: {1})

  • run. – (default: {1000})

  • use (dc_type {DCTypes} -- Type for diffusion coefficient to) – in the single node calculations. (default: {DCTypes.TRC})

Return type:

None

write_gen_poly(fname, nominal_point, fit=array([], dtype=float64), from_ants=True, write_common=True, diff_coef_type=DCTypes.TRC, version=1)

Parametrizes the reflector data according to the generic polynomial format and writes it to a file.

Parameters:
  • fname (str) – Output filename.

  • nominal_point (np.ndarray) – Nominal point for the fitting.

  • fit (np.ndarray, optional) – Fit array. Defaults to np.array(()).

  • from_ants (bool, optional) – Use discontinuity factors evaluated with Ants instead of directly from Serpent? Defaults to True.

  • write_common (bool, optional) – Write common block for GenPoly file? Defaults to True.

  • diff_coef_type (DCTypes, optional) – Which diffusion coefficient type to include? Defaults to DCTypes.TRC.

  • version (int, optional) – Which GenPoly version to use? Defaults to 1.

write_h_trc_input(folder='./', fname='sss_calc_trc.inp', therm_lib_id='lwe7', xs_lib_id='e71xe')

Writes Serpent input for generating hydrogen TRC curves.

Keyword Arguments:
  • (default (xs_lib_id {str} -- Which cross section data to use) – {“./”})

  • (default – {“sss_calc_trc.inp”})

  • (default – {“lwe7”})

  • (default – {“e71xe”})

Return type:

None

write_serpent_radial_reflector_files(folder='./')

Writes files required to set up ADF and GC calculation for current core lattice.

Parameters:

folder (str, optional) – Output folder. Defaults to “./”.

Return type:

None