Core module

Core class

class coreutils.core.Core(inpjson)

Define NE, TH and CZ core configurations.

Parameters:

inpjson (string) – Path to the input file in .json format.

AssemblyGeom

Object with assembly geometrical features.

Type:

coreutils.core.Geometry.AssemblyGeometry

Map

Object mapping the core assemblies with the different numerations.

Type:

coreutils.core.Map

NAss

Number of assemblies.

Type:

int

NE

Object for the NEutronic configuration.

Type:

coreutils.core.NE

TH

Object for the Thermo-Hydraulic configuration.

Type:

coreutils.core.TH

Tc

Array with coolant temperatures for NE data.

Type:

np.array

Tf

Array with fuel temperatures for NE data.

Type:

np.array

TfTc

Array with fuel and coolant temperatures for NE data.

Type:

np.array

TimeEnd

End simulation time in seconds.

Type:

float

dim

Number of spatial dimensions.

Type:

int

power

Total power in Watt.

Type:

float

trans

Boolean for transient case.

Type:

bool

FreneticNamelist

Dictionary containing keywords needed for FRENETIC input.

Type:

dict

getassemblytype :

Get type of a certain assembly.

replace :

Replace assemblies with user-defined new or existing type.

perturb :

Replace assemblies with user-defined new or existing type.

translate :

Replace assemblies with user-defined new or existing type.

perturbBC :

Spatially perturb cooling zone boundary conditions.

writecentermap :

Write assembly number and x and y coordinates of centers to text file.

getassemblylist :

Return assemblies belonging to a certain type.

writecorelattice :

Write core lattice to txt file.

from_json(inpjson)

Generate object from .json file.

Parameters:

inpjson (string) – Path to .json input file

Raises:
  • OSError – If input file is not in .json format

  • OSError – If input rotation angle is != 60 for hexagonal assemblies

  • OSError – If NE input is not provided

  • OSError – If CZ and NE assembly map are not consistent

  • OSError – If CZ and TH assembly map are not consistent

getassemblylist(atype, config, match=True, isfren=False)

Return assemblies belonging to a certain type.

Parameters:
  • atype (int) – Desired assembly type.

  • config (np.array) – Array defining the assembly arrangement with integers

  • match (bool, optional) – If True, it takes the assemblies matching with atype. If False, it takes all the others, by default True.

  • isfren (bool, optional) – Flag for FRENETIC numeration, by default False

Returns:

matchedass – List of matching/non-matching assemblies.

Return type:

list

getassemblytype(assemblynumber, config, isfren=False)

Get type of a certain assembly.

Parameters:
  • assemblynumber (int) – Number of the assembly of interest

  • config (np.array) – Array defining the assembly arrangement with integers

  • isfren (bool, optional) – Flag for FRENETIC numeration, by default False

Returns:

which – Type of assembly corresponding to assemblynumber.

Return type:

int

writecentermap(numbers=True, fren=True, fname='centermap.txt')

Write assembly number and x and y coordinates of centers to text file.

Parameters:
  • numbers (bool, optional) – Write assembly numbers in the first columns, by default True. If False, the assembly type are written instead.

  • fren (bool, optional) – Flag for FRENETIC numeration, by default False

  • fname (str, optional) – Centermap file name, by default “centermap.txt”.

Return type:

None

writecorelattice(flatten=False, fname='corelattice.txt', serpheader=False, string=True, whichconf='NE', numbers=False, fren=True, time=0)

Write core lattice to txt file.

Parameters:
  • flatten (bool, optional) – Flag to print matrix or flattened array, by default False.

  • fname (str, optional) – File name, by default “corelattice.txt”.

  • serpheader (bool, optional) – Serpent 2 code instructions for core lattice geometry header, by default False.

  • string (bool) – Format of the file entries, by default True.

  • whichconf (string) – Type of configuration, by default "NE".

  • numbers (bool, optional) – Print assembly numbers instead of assembly names in the core lattice.

  • fren (bool, optional) – Flag for FRENETIC numeration, by default True

  • time (float) – Time instant of the desired configuration, in seconds

Return type:

None

Geometry class

class coreutils.core.Geometry.Geometry(GEargs=None, inpdict=None)

Define an object representing the geometry of the core.

Parameters:

GEargs (dict, optional) – Dict containing info to build the object, by default None.

inpdict: dict, optional

Object stored as a dict, by default None.

edge

Assembly edge

Type:

str

area

Assembly area

Type:

float

perimeter

Assembly perimeter

Type:

float

type

Assembly type.

Type:

str

numedges

Number of edges of the assembly

Type:

int

compute_volume(self, height):

Compute volume of the assembly slice.

class coreutils.core.Geometry.AssemblyGeometry(pitch=None, asstype=None, inpdict=None)

Define an assembly object in the x-y plane.

Parameters:
  • pitch (float, optional) – Pitch of the assembly, by default None. If None, it assumed that the object is parsed from a dictionary.

  • asstype (string, optional) – It can be “H” (hexagonal) or “S” (squared), by default None. If None, it assumed that the object is parsed from a dictionary.

  • inpdict (dict, optional) – Object stored as a dict, by default None.

edge

Assembly edge

Type:

str

area

Assembly area

Type:

float

perimeter

Assembly perimeter

Type:

float

type

Assembly type.

Type:

str

numedges

Number of edges of the assembly

Type:

int

compute_volume(self, height):

Compute volume of the assembly slice.

compute_volume(height)

Compute volume of the assembly slice.

Parameters:

height (float) – Axial width considered for the volume.

Returns:

volume – Volume of the assembly slice

Return type:

float

class coreutils.core.Geometry.LatticeGeometry(ass_pitch=None, n_pins=None, pin_radius=None, pin_pitch=None, lattype=None, wrap_width=0, wrap_mat=None, inter_ass_width=0, inpdict=None)

Define a regular lattice object in the x-y plane. Now only lattices with identical pins are supported.

Parameters:
  • ass_pitch (float, optional) – Pitch of the lattice, by default None. If None, it assumed that the object is parsed from a dictionary.

  • n_pins (int, optional) – Number of pins composing the lattice, by default None. If None, it assumed that the object is parsed from a dictionary.

  • pin_radius (float, optional) – External radius of the pin (i.e., the surface in contact with the fluid), by default None. If None, it assumed that the object is parsed from a dictionary.

  • pin_pitch (float, optional) – Pin-to-Pin distance, by default None. If None, it assumed that the object is parsed from a dictionary.

  • lattype (string, optional) – It can be “H” (hexagonal) or “S” (squared), by default None. If None, it assumed that the object is parsed from a dictionary.

  • wrap_width (str, optional) – Thickness of the wrapper (box) enclosing the pins and the coolant, by default 0.

  • wrap_width – Constituting material of the wrapper (box) enclosing the pins and the coolant, by default None.

  • inter_ass_width (float, optional) – Thickness of the coolant layer between each lattice and its neighbour (inter-assembly clearance), by default 0.

  • inpdict (dict, optional) – Object stored as a dict, by default None.

type

Lattice type.

Type:

str

nPins

Number of pins.

Type:

int

pinRad

Radius of the pin.

Type:

float

pitch

Lattice pitch.

Type:

float

wrapWidth

Thickness of the wrapper (box) enclosing the pins and the coolant.

Type:

float

interAssWidth

Thickness of the coolant layer between each lattice and its neighbour (inter-assembly clearance).

Type:

float

coolArea

Area occupied by the coolant.

Type:

float

flowArea

Area of the transverse flow in the elementary cell.

Type:

float

pinArea

Area occupied by the pins.

Type:

float

wrapArea

Area occupied by the wrapper.

Type:

float

interassArea

Area occupied by the inter-assembly clearance.

Type:

float

wetPerimenter

Wet perimeter inside the lattice.

Type:

float

class coreutils.core.Geometry.PinGeometry(pindict=None, inpdict=None)

Define a pin object in the x-y plane.

Parameters:
  • pindict (dict, optional) – Dict containing materials as keys and radius in cm as values, by deafult None.

  • inpdict (dict, optional) – Object stored as a dict, by default None.

materials

List of material strings.

Type:

list

radii

Array with pin radii in increasing order.

Type:

np.array

class coreutils.core.Geometry.AxialConfig(cuts=None, splitz=None, labels=None, NE_dim=3, inpdict=None, assemblynames=None)

Define the NE axial core configuration at a certain time instant.

Parameters:
  • cuts (dict, optional) – Cuts defining different material regions, by default None

  • splitz (list, optional) – List with the number of elements per axial region, by default None

  • labels (list, optional) – List of region labels, by default None

  • NE_dim (int, optional) – Number of spatial dimensions of the model, by default 3

  • inpdict (_type_, optional) – Input dictionary with the object (if read outside this class), by default None

  • assemblynames (list, optional) – List with names of the various assembly type, by default None

cuts

Dictionary with values AxialCuts objects assigned to assembly type

Type:

ordered dict

zcuts

List of cuts common to the whole reactor

Type:

list

nZ

Number of zcuts.

Type:

int

cutsregions

Dict containing the regions composing the various cuts of each assembly type. It is useful to identify the regions involved in the the spatial homogenisation.

Type:

ordered dict

cutslabels

Dict containing the labels of the regions composing the various cuts of each assembly type. It is useful to identify the regions involved in the the spatial homogenisation.

Type:

ordered dict

cutsweights

Dict containing the weight of each regions composing the various cuts of each assembly type. It is useful to identify the percentage of each regions involved in the the spatial homogenisation.

Type:

ordered dict

regions

Dict mapping the number identifying each region (integer) with its name (string)

Type:

ordered dict

labels

Dict mapping the name of each region with its own label. More regions could share the same label.

Type:

ordered dict

config_str

Dict containing the axial regions (as string) inside each assembly type (dict keys).

Type:

ordered dict

config

Dict containing the number of axial regions inside each assembly type (dict keys).

Type:

ordered dict

homogenised

Flag to indicate if regions are homogenised.

Type:

bool

splitz

Number of elements in each axial region. The array has length equal to the number of zcuts -1.

Type:

np.array

AxNodes

Axial coordinates. The array has length equal to the sum of all the numbers in splitz.

Type:

np.array

dz

Height of each axial element. The array has length equal to the sum of all the numbers in splitz.

Type:

np.array

nReg: returns the number of regions.
mapFine2Coarse: returns the regions, labels and weights for

the axial regions involved in the spatial homogenisation.

static mapFine2Coarse(cuts, zcuts)

Generate dictionaries with region names, labels and weights for homogenisation.

Parameters:
  • cuts (ordered dict) – Dictionary with values AxialCuts objects assigned to assembly type

  • zcuts (list) – List of cuts common to the whole reactor

Returns:

_description_

Return type:

_type_

Raises:

OSError – _description_

property nReg

Returns the number of NE axial regions.

Returns:

Number of NE regions in the object.

Return type:

int

class coreutils.core.Geometry.AxialCuts(up=None, lo=None, r=None, labels=None, inpdict=None)

Define the axial cuts for a certain type of assembly.

Parameters:
  • up (list, optional) – Upper z-coordinate, by default None

  • lo (list, optional) – Lower z-coordinate, by default None

  • r (list, optional) – String identifying the region within upz and lowz, by default None

  • labels (list, optional) – Label for the region within upz and lowz, by default None

  • inpdict (dict, optional) – Input dictionary containing the object (if it comes from the outside), by default None

upz

Upper z-coordinate

Type:

list

loz

Lower z-coordinate

Type:

list

reg

String identifying the region within upz and lowz

Type:

list

labels

Label for the region within upz and lowz.

Type:

list

mesh1d: Compute nodes according to FRENETIC mesh1d.f90
mesh1d(mesh0)

Compute nodes according to FRENETIC mesh1d.f90

Parameters:
  • split (np.array) – Array with axial split.

  • mesh0 (list or np.array) – Iterable with axial boundaries.

Returns:

  • mesh (np.array) – Axial mesh

  • centers (np.array) – Centers of each axial cell

class coreutils.core.Geometry.GeometryError

Map class

class coreutils.core.Map.Map(geinp=None, rotangle=None, Geom=None, regionsdict=None, inp=None, inpdict=None)

Build the nuclear reactor core geometry map defined in a file.

Parameters:
  • geinp (str or np.array) – If str it is the <Path/filename> of the input file containing the geometry arrangement of the core, if np.array the geometry arrangement is already defined by the user.

  • rotangle (int) – rotation angle over which the arrangement is symmetrically rotated. The rotation angle should be passed in degree (only 0,60,45,90,180 values are allowed). With rotangle=0 no rotation occurs.

  • Geom (Geometry) – Geometry object.

  • regionsdict (dict) –

  • inp (np.array) – 2D array representing the reactor core sector defined in input. The entries represent the assembly types.

  • inpdict (dict) – Input dictionary, by default False

inp

2D array representing the reactor core sector defined in input. The entries represent the assembly types.

Type:

np.array

type

The geometry arrangement of the core.

Type:

np.array

rotation_angle

Rotation angle employed to unfold the input geometry

Type:

int

Nx

Number of assemblies along x

Type:

int

Ny

Number of assemblies along y

Type:

int

fren2serp

Dictionary mapping the assemblies according to the FRENETIC numeration to the one employed by Serpent 2.

Type:

dict

serp2fren

Dictionary mapping the assemblies according to the Serpent 2 numeration to the one employed by FRENETIC.

Type:

dict

serpcentermap

Dictionary mapping assembly number to its center coordinates.

Type:

dict

getSAsextant(sext)

Get SAs belonging to a certain core sextant (for hexagonal SAs).

Parameters:

sext (int) – Sextant number. The first sextant is obtained drawing an angle of 60 degrees in the quadrant x>0, y>0. Then the others are obtained moving counter-clockwise.

class coreutils.core.Map.MapError

MaterialData class

class coreutils.core.MaterialData.NEMaterial(uniName=None, energygrid=None, datapath=None, egridname=None, h5file=None, reader='json', serpres=None, basename=False, temp=False, datacheck=True, init=False, P1consistent=False)

Create material regions with multi-group constants.

Parameters:
  • uniName (str) – Universe name.

  • energygrid (iterable) – Energy group structure containing nE+1 group boundaries where nE is the number of energy groups.

  • datapath (str, optional) – Path to the file containing the data, by default None. If None, data are taken from the local database.

  • egridname (str, optional) – Name of the energy group structure, by default None.

  • h5file (object) – h5 group from .h5 files.

  • reader (str``) – Type or reader. It can be 'serpent', 'json' or 'txt'.

  • serpres (serpentTools.ResultsReader) – Object created parsing the _res.m Serpent file with serpentTools

  • basename (bool or str) – if not False, base name is used to compose the filenames, which needs to be in the form <basename>_Tf_XXX_Tc_XXX.

  • temp (tuple) – if basename is not None, directories in the form “Tf_{}_Tc_{}” are searched and “Tf_{}_Tc_{}” suffix is attached to the file name

  • datacheck (bool, optional) – Flag to check and ensure data consistency, by default True.

  • init (bool, optional) – Flag to initialise the object as empty, by default False

nE

Number of energy groups.

Type:

int

egridname

Name of the energy grid.

Type:

str

energygrid

List of energy group boundaries.

Type:

list

UniName

Name of the material.

Type:

str

NPF

Number of neutron precursors families.

Type:

int

L

Scattering anisotropy order

Type:

int

Tot

1D array of length nE with the total cross section in cm^-1.

Type:

np.array

Abs

1D array of length nE with the absorption cross section in cm^-1.

Type:

np.array

Capt

1D array of length nE with the capture cross section in cm^-1.

Type:

np.array

Fiss

1D array of length nE with the fission cross section in cm^-1.

Type:

np.array

Remxs

1D array of length nE with the removal cross section in cm^-1.

Type:

np.array

Transpxs

1D array of length nE with the transport cross section in cm^-1.

Type:

np.array

NuSf

1D array of length nE with the fission production cross section in cm^-1.

Type:

np.array

Diffcoef

1D array of length nE with the diffusion coefficient in cm.

Type:

np.array

Difflength

1D array of length nE with the diffusion length in cm.

Type:

np.array

S0

2D array of size (nE, nE) with the scattering matrix cross section in cm^-1.

Type:

np.array

Chit

1D array of size nE with the total fission emission spectrum.

Type:

np.array

Chip

1D array of size nE with the prompt fission emission spectrum.

Type:

np.array

Chid

1D array of size nE with the delayed fission emission spectrum.

Type:

np.array

Nubar

1D array of size nE with the number of neutrons emitted by fission.

Type:

np.array

Invv

1D array of size nE with the inverse of the neutron velocity in s/cm.

Type:

np.array

lambda

1D array of size NPF with the decay constants of the precursors.

Type:

np.array

beta

1D array of size NPF with the delayed neutron fracitons.

Type:

np.array

Flx

1D array of size nE with the flux energy spectrum in arbitrary units.

Type:

np.array

collapse(fewgrp, spectrum=None, egridname=None)

Collapse in energy the multi-group data.

Parameters:
  • fewgrp (iterable) – Few-group structure to perform the collapsing.

  • spectrum (array, optional) – Spectrum to perform the energy collapsing, by default None. If None, the Flx attribute is used as a weighting spectrum.

  • egridname (str, optional) – Name of the energy grid, by default None.

Raises:

OSError – Collapsing failed: weighting flux missing in {}.

Return type:

None.

datacheck()

Check data consistency and add missing data.

Parameters:

None.

Return type:

None.

getxs(key, pos1=None, pos2=None)

Get material data (for a certain energy group, if needed).

Parameters:
  • key (str) – User selected nuclear data.

  • pos1 (int, optional) – Departure energy group for scattering matrix. If not provided, data over all the energy groups are returned. The default is None.

  • pos2 (int, optional) – Arrival energy group for scattering matrix. If not provided, data over all the energy groups are returned. The default is None.

Returns:

vals – 1-D numpy.ndarray with G/NPF (groups) rows.

Return type:

numpy.ndarray

isfiss()

Assess whether the material is fissile

perturb(what, howmuch, depgro=None, sanitycheck=True)

Perturb material composition.

Parameters:
  • what (str) – Type of perturbation. If what="density", the density of the material is perturbed, otherwise the other data can be perturbed by indicating the data. For instance, what="Fiss" or what="Nubar".

  • howmuch (list or float) – Magnitude of the perturbation. If list, its length must be equal to nE, and the perturbation is applied to each group. If it is a float, the perturbation is applied to the material density.

  • depgro (int, optional) – Departure energy group, by default False. This argument is needed to perturb the scattering cross section.

  • sanitycheck (bool, optional) – Flag to check and ensure data consistency, by default True.

Return type:

None.

plot(what, depgro=False, family=1, ax=None, figname=None, normalise=True, **kwargs)

Plot multi-group data from the object.

Parameters:
  • what (str) – Data to be plotted.

  • depgro (int, optional) – Departure energy group, by default False. This argument is needed to plot the scattering cross section.

  • family (int, optional) – Number of neutron precursor family, by default 1

  • ax (matplotlib.axes.Axes, optional) – Ax on which to plot the data, by default None. If not provided, a new figure is created.

  • figname (str, optional) – Figure name with its extension, by default None

  • normalise (bool, optional) – Normalisation flag, by default True

Raises:

OSError – If the depgro argument is not provided when the data to be plotted is the scattering matrix.

to_json(fname=None)

Dump object to json file.

Parameters:

fname (str, optional) – Filename, by default None.

Return type:

None.

class coreutils.core.MaterialData.CZdata(mflow, pressures, temperatures, CZassemblynames)

Assign Cooling Zones material data to the reactor core.

Parameters:
  • mflow (list) – List with mass flow rates, one for each cooling zone.

  • pressures (list) – List with pressures, one for each cooling zone.

  • temperatures (list) – List with temperatures, one for each cooling zone.

  • CZassemblynames (list) – List with cooling zone names, sorted consistently with the physical parameter lists.

massflowrates

Dict with mass flow rates. The keys are the cooling zone.

Type:

dict

pressures

Dict with pressures. The keys are the cooling zone.

Type:

dict

temperatures

Dict with temperatures. The keys are the cooling zone.

Type:

dict

class coreutils.core.MaterialData.THHexData(which, inpdict)

Assign TH material data to the reactor core.

Parameters:
  • which (list) – List of assemblies assigned to the current type.

  • inpdict (dict) –

iHA

List of assemblies assigned to the current type.

Type:

list

frictMult

Friction factor multiplier

Type:

float

htcMult

Heat Transfer Coefficient multiplier

Type:

float

htcCorr

Heat Transfer Coefficient correlation

Type:

str

frictCorr

Friction factors correlations

Type:

str

chanCouplCorr

Correlation for coupling channels

Type:

str

class coreutils.core.MaterialData.NEMaterialError
class coreutils.core.MaterialData.THDataError

NE class

class coreutils.core.NE.NE(NEargs=None, CI=None, inpdict=None, datacheck=True)

Define NE core configurations.

labels

Dictionary with regions names and strings for plot labelling.

Type:

dict

assemblytypes

Ordered dictionary with names of assembly NE types.

Type:

dict

Map

Object mapping the core assemblies with the different numerations.

Type:

obj

AxialConfig

Axial regions defined for NE purposes.

Type:

obj

data

NE data (multi-group constants) for each region defined in input. Neutronics configurations according to time.

Type:

obj

time

Neutronics time instants when configuration changes.

Type:

list

replace :

Replace assemblies with user-defined new or existing type.

perturb :

Replace assemblies with user-defined new or existing type.

translate :

Replace assemblies with user-defined new or existing type.

critical(core, prt, time)

Enforce criticality, given the static keff of the system

Parameters:

core (_type_) – _description_

get_fissile_SA(core, t=0)

Return number of fissile types in a core configuration at time t.

Parameters:

core (_type_) – _description_

Returns:

_description_

Return type:

_type_

get_fissile_types(t=0)

Return fissile assembly types.

Returns:

fissile_types – Return fissile assembly types.

Return type:

list

perturb(core, prt, time=0, sanitycheck=True, isfren=True, action='pert')

Perturb material composition.

Parameters:
  • what (TYPE) – DESCRIPTION.

  • howmuch (TYPE) – DESCRIPTION.

Return type:

None.

replace(core, rpl, time, isfren=False, action='repl')

Replace full assemblies or axial regions.

This method is useful to replace axial regions in 1D or 3D models. Replacements can affect disjoint regions, but each replacement object should involve either the region subdivision (self.NE.AxialConfig.zcuts) or the xscuts subdivision (the one in self.NE.AxialConfig.cuts[AssType]). If the replacement affect this last axial grid, homogenised data are computed from scratch and added to the material regions. The methods perturb and translate rely on this method to arrange the new regions.

Parameters:

isfren (bool, optional) – Flag for FRENETIC numeration, by default False.

Return type:

None

replaceSA(core, repl, time, isfren=False)

Replace full assemblies or axial regions.

Parameters:
  • repl (dict) – Dictionary with SA name as key and list of SAs to be replaced as value

  • isfren (bool, optional) – Flag for FRENETIC numeration, by default False.

Return type:

None

translate(core, transconfig, time, isfren=False, action='trans')

Replace assemblies with user-defined new or existing type.

Parameters:
  • transconfig (dict) – Dictionary with details on translation transformation

  • isfren (bool, optional) – Flag for FRENETIC numeration, by default False.

Return type:

None

class coreutils.core.NE.NEError

TH class

class coreutils.core.TH.TH(THargs=None, CI=None, inpdict=None)

Define TH core configurations.

labels

Dictionary with regions names and strings for plot labelling.

Type:

dict

assemblytypes

Ordered dictionary with names of assembly NE types.

Type:

dict

AxialConfig

Axial regions defined for NE purposes.

Type:

obj

data

NE data (multi-group constants) for each region defined in input. Neutronics configurations according to time.

Type:

obj

time

Neutronics time instants when configuration changes.

Type:

list

from_dict:
replaceSA:

Replace full assemblies.

perturbBC:

Spatially perturb cooling zone boundary conditions.

perturbBC(core, pertconfig, time, isfren=False)

Spatially perturb cooling zone boundary conditions.

Parameters:
  • newtype (list) – List of new/existing types of assemblies.

  • asslst (list) – List of assemblies to be replaced.

  • isfren (bool, optional) – Flag for FRENETIC numeration, by default False.

Return type:

None

replaceSA(core, repl, time, configtype='CZ', isfren=False)

Replace full assemblies.

Parameters:
  • repl (dict) – Dictionary with SA name as key and list of SAs to be replaced as value

  • isfren (bool, optional) – Flag for FRENETIC numeration, by default False.

Return type:

None

coreutils.core.TH.meshTH1d(zmin, zmax, nvol, nvolref=None, zminref=None, zmaxref=None)
provide baricenter of each nodes between zmin and zmax with optional refinement.

This method is based on the subroutine mesh.f90 of FRENETIC.

Parameters:
  • zmin (float) – Minimum axial coordinate.

  • zmax (float) – Maximum axial coordinate.

  • nvol (integer) – Number of axial volumes.

  • nvolref (integer, optional) – Number of volumes to be used in the refined region.

  • zminref (float) – Minimum axial coordinate in the refined region.

  • zmaxref (float) – Maximum axial coordinate in the refined region.

Returns:

centers – Centers of each axial cell

Return type:

np.array

UnfoldCore class

class coreutils.core.UnfoldCore.UnfoldCore(inpge, rotangle, regionsdict)

Set of methods to rotate the input reactor core geometry.

coremap

2D array representing the whole reactor core. The entries represent the assembly types

Type:

array[int]

inp

2D array representing the reactor core sector defined in input. The entries represent the assembly types

Type:

array[int]

static rot180(coremap, N)

Perform a counterclockwise 180° rotation.

Parameters:
  • coremap (array[int]) – 2D array representing a 180° portion of the reactor core

  • N (int) – number of nonzero elements in the file

Returns:

coremap – 2D array representing the whole reactor core

Return type:

array[int]

static rot45(coremap, N)

Perform a counterclockwise 45° rotation.

Parameters:
  • coremap (np.array[int]) – 2D array representing a 45° portion of the reactor core

  • N (int) – number of nonzero elements in the file

Returns:

coremap – 2D array representing the whole reactor core

Return type:

np.array[int]

static rot60(coremap)

Perform a counterclockwise 60° rotation.

Parameters:
  • coremap (array[int]) – 2D array representing a 60° portion of the reactor core

  • N (int) – number of nonzero elements in the file

Returns:

coremap – 2D array representing the whole reactor core

Return type:

array[int]

static rot90(coremap, N)

Perform a counterclockwise 90° rotation.

Parameters:
  • coremap (array[int]) – 2D array representing a 90° portion of the reactor core

  • N (int) – number of nonzero elements in the file

Returns:

coremap – 2D array representing the whole reactor core

Return type:

array[int]