FRENETIC

Input generation

coreutils.frenetic.InpGen.auxNE(core, AUXpathNE)

Generate NE auxiliary files.

Parameters:
  • core (coreutils.core.Core) – Core object created with Core class.

  • AUXpathNE (str) – Path to auxiliary NE directory.

coreutils.frenetic.InpGen.auxTH(core, AUXpathTH)

Generate TH auxiliary files.

Parameters:
  • core (coreutils.core.Core) – Core object created with Core class.

  • AUXpathTH (str) – Path to auxiliary TH directory.

coreutils.frenetic.InpGen.fillFreneticNamelist(core)

Fill FRENETIC kw dict with missing data, ensuring their consistency.

Parameters:

core (coreutils.core.Core) – Object storing the information needed to fill the missing keys.

Raises:

FreneticNamelistError – If a keyword is not specified

coreutils.frenetic.InpGen.inpgen(core, json)

Make FRENETIC NE/TH files if the required data are in core object.

Parameters:
  • core (coreutils.core.Core) – Core object created with Core class.

  • json (str) – Absolute path of the .json input file.

Return type:

None

coreutils.frenetic.InpGen.makecommoninput(core)

Make common_input.inp file.

Parameters:

core (coreutils.core.Core) – Core object created with Core class.

Return type:

None

coreutils.frenetic.InpGen.mkdir(dirname, indirs=None)

Make a new directory named dirname inside path.

Parameters:
  • dirname (string) – directory name

  • indirs (list, optional) – List of directories where the new directory is created, by default None

Returns:

path – Path of created directory

Return type:

str

coreutils.frenetic.InpGen.print_coreutils_info()

Print information for reproducibility.

Parameters:

None

Return type:

None

coreutils.frenetic.InpNE.makeNEinput(core, H5fmt=2)

Make input.inp file.

Parameters:
  • core (obj) – Core object created with Core class

  • template (str, optional) – File path where the template file is located, by default None. In this case, the default template is used

Return type:

None

coreutils.frenetic.InpNE.mysavetxt(fname, x, fmt='%.6e', delimiter=' ')

Write file in txt format.

Parameters:
  • fname (str) – File name.

  • x (ndarray) – Data to be written in txt.

  • fmt (str, optional) – Data output format, by default “%.6e”.

  • delimiter (str, optional) – Delimiter between data, by default ‘ ‘.

Return type:

None.

coreutils.frenetic.InpNE.writeConfig(core)

Write config.inp file.

Parameters:

core (obj) – Core object created with Core class.

Return type:

None

coreutils.frenetic.InpNE.writeNEdata(core, verbose=False, txt=False, H5fmt=2)

Generate FRENETIC NE module input (HDF5 file or many txt).

Parameters:
  • core (obj) – Core object created with Core class

  • verbose (bool, optional) – Set to True in order to print also capture, nubar and scattering production data, by default False

  • inf (bool, optional) – Set to False to get B1 Serpent calculation mode for the multi-group constants, by default True

  • txtfmt (bool, optional) – Set to True to print data also in .txt format, by default False

Return type:

None

coreutils.frenetic.InpNE.writemacro(core, nmix, vel, lambda0, beta0, temps, unimap, H5fmt=2)

Write the input file “macro.nml” for the NE module of FRENETIC.

Parameters:
  • core (obj) – Core object created with Core class

  • nmix (int) – Number of different regions after homogenisation in the core

  • vel (ndarray) – Multi-group velocity [cm/s]

  • lambda0 (ndarray) – Precursors’ families decay constants

  • beta0 (ndarray) – Precursors’ families physical neutron delayed fraction

  • temps (list) – List of tuples with T fuel and T coolant used to evaluate NE data

  • unimap (dict) – Dictionary mapping in which list each universe is located in core.NE.data.data dict

Return type:

None

coreutils.frenetic.InpTH.makeTHinput(core)

Make input.inp file.

Parameters:

core (coreutils.core.Core) – Core object.

Return type:

None

coreutils.frenetic.InpTH.writeCZdata(core)

Generate TH input data related to cooling zones.

Parameters:

core (coreutils.core.Core) – Core object created with Core class.

Return type:

None

coreutils.frenetic.InpTH.writeTHdata(core)

Generate TH input data.

Parameters:

core (coreutils.core.Core) – Core object created with Core class.

Return type:

None

Output post-processing

class coreutils.frenetic.NEoutput.NEoutput(path)

Class to read NE profiles computed by FRENETIC.

RadialMap(what, z=0, t=0, pre=0, gro=1, grp=0, label=False, figname=None, hex=None, usetex=False, fill=True, axes=None, cmap=None, thresh=None, cbarLabel=True, xlabel=None, ylabel=None, log=None, title=True, scale=1, fmt='%.2f', **kwargs)

Plot FRENETIC output on the x-y plane.

Parameters:
  • label (TYPE, optional) – DESCRIPTION, by default False.

  • figname (TYPE, optional) – DESCRIPTION, by default None.

  • fren (TYPE, optional) – DESCRIPTION, by default False.

  • which (TYPE, optional) – DESCRIPTION, by default None.

  • what (TYPE, optional) – DESCRIPTION, by default None.

  • usetex (TYPE, optional) – DESCRIPTION, by default False.

  • fill (TYPE, optional) – DESCRIPTION, by default True.

  • axes (TYPE, optional) – DESCRIPTION, by default None.

  • cmap (TYPE, optional) – DESCRIPTION, by default ‘Spectral_r’.

  • thresh (TYPE, optional) – DESCRIPTION, by default None.

  • cbarLabel (TYPE, optional) – DESCRIPTION, by default None.

  • xlabel (TYPE, optional) – DESCRIPTION, by default None.

  • ylabel (TYPE, optional) – DESCRIPTION, by default None.

  • loglog (TYPE, optional) – DESCRIPTION, by default None.

  • logx (TYPE, optional) – DESCRIPTION, by default None.

  • logy (TYPE, optional) – DESCRIPTION, by default None.

  • title (TYPE, optional) – DESCRIPTION, by default None.

  • scale (TYPE, optional) – DESCRIPTION, by default 1.

  • fmt (TYPE, optional) – DESCRIPTION, by default “%.2f”.

  • **kwargs (TYPE) – DESCRIPTION.

Raises:
Return type:

None.

eplot(eflx=None, t=None, z=None, hex=None, ax=None, pre=False, title=None, figname=None, egrid=False, lethargynorm=True, logx=True, logy=True, **kwargs)

Plot solution along energy for a certain portion of the phase space.

Return type:

None.

get(which, t=None, z=None, hex=None, pre=None, gro=None, grp=None, prp=None, oldfmt=False)

Get profile from output.

Parameters:
  • which (string) – Name of the variable to be parsed

  • hex (integer or iterable, optional) – Number of assembly, by default None.

  • t (float or iterable, optional) – Time instant(s), by default None.

  • z (float or iterable, optional) – Axial coordinate(s), by default None.

  • pre (integer or iterable, optional) – Precursor families, by default None.

  • gro (integer or iterable, optional) – Neutron energy group(s), by default None.

  • grp (integer or iterable, optional) – Photon energy group(s), by default None.

  • prp (integer or iterable, optional) – Photon precursor family, by default None.

  • oldfmt (bool, optional) – Flag to read output in the old txt format. Default is False.

Returns:

profile – Output profile requested.

Return type:

array

plot1D(which, gro=None, t=None, grp=None, pre=None, prp=None, ax=None, abscissas=None, z=None, hex=None, leglabels=None, figname=None, xlabel=None, xlims=None, ylims=None, ylabel=None, geometry=None, oldfmt=False, style='sty1D.mplstyle', legend=True, **kwargs)

Plot time/axial profile of integral param. or distribution in hex.

Parameters:
  • which (string) – Profile name according to FRENETIC namelist.

  • zt (ndarray, optional) – Axial or time grid, by default None.

  • figname (TYPE, optional) – Name assigned to the figure for saving, by default None.

Return type:

None.

class coreutils.frenetic.THoutput.THoutput(path)

Class to read TH profiles computed by FRENETIC.

Parameters:

path (str) – Path to the FRENETIC case.

casepath

Path to the FRENETIC case.

Type:

str

THpath

Path to the TH directory in the FRENETIC case.

Type:

str

core

Object representing the core of the FRENETIC simulation.

Type:

coreutils.core.Core

mapHAType

Dict mapping the types of the various assemblies. The keys are the HA types, while the values are lists containing the numbers of the HA according to FRENETIC numeration.

Type:

dict

inout

List of str with the names of the In-Out quantities.

Type:

list

maximum

List of str with the names of the Maximum quantities.

Type:

list

distributions

List of str with the names of the Distributions (e.g., the coolant temperature).

Type:

list

aliases

Dict mapping possible aliases of the quantities in inlet_outlet and maximum.

Type:

dict

inout_measure

Dict mapping the unit of measure of the In-Out quantities.

Type:

dict

maximum_measure

Dict mapping the unit of measure of the Maximum quantities.

Type:

dict

distributions_measure

Dict mapping the unit of measure of the Distributions.

Type:

dict

distrout_descr

Dict with the descriptions of the Distributions.

Type:

dict

inout_descr

Dict with the descriptions of the In-Out quantities.

Type:

dict

maximum_descr

Dict with the descriptions of the Maximum quantities.

Type:

dict

RadialMap(what, z=0, t=0, label=False, figname=None, hex=None, usetex=False, fill=True, axes=None, cmap=None, thresh=None, cbarLabel=True, xlabel=None, ylabel=None, log=None, title=True, scale=1, fmt='%.2f', **kwargs)

Plot FRENETIC output on the x-y plane.

Parameters:
  • what (string) – Field to be plotted.

  • z (float, optional) – Axial coordinate, by default 0

  • t (float, optional) – Time instant, by default 0

  • label (bool, optional) – plot label, by default False

  • figname (string, optional) – Name of the figure to be saved, with its extension, by default None

  • hex (list, optional) – List of assemblies to be plotted, by default None

  • usetex (bool, optional) – Boolean for LaTeX string formatting, by default False

  • fill (bool, optional) – Bool to fill the patch with colours, by default True

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

  • cmap (str, optional) – Name of the color map, by default ‘Spectral_r’

  • thresh (float, optional) – Avoid plot data below this threshold, by default None

  • cbarLabel (bool, optional) – Boolean for the label of the colorbar, by default True

  • xlabel (string, optional) – Label of the x-axis, by default None

  • ylabel (string, optional) – Label of the y-axis, by default None

  • log (bool, optional) – Boolean for a log scale, by default None

  • title (bool, optional) – Boolean for the plot title, by default True

  • scale (int, optional) – Scaling parameter for the plot, by default 1

  • fmt (str, optional) – String format, by default “%.2f”

Raises:

None

get(which, hex=None, t=None, z=None)

Get profile from output.

Parameters:
  • which (string) – Name of the variable to be parsed

  • hex (integer or iterable, optional) – Number of assembly, by default None.

  • t (float or iterable, optional) – Time instant(s), by default None.

  • z (float or iterable, optional) – Axial coordinate(s), by default None.

Returns:

profile – Output profile requested.

Return type:

array

plot1D(which, t=None, ax=None, abscissas=None, z=None, hex=None, leglabels=None, figname=None, xlabel=None, xlims=None, ylims=None, ylabel=None, autolabel=True, style='sty1D.mplstyle', legend=True, **kwargs)

Plot time/axial profile of integral parame. or distribution in hex.

Parameters:
  • which (str) – Name of the variable to be parsed

  • t (float or iterable, optional) – Time instant(s), by default None.

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

  • abscissas (list, optional) – User-defined coordinates for the x-axis, by default None

  • z (float or iterable, optional) – Axial coordinate(s), by default None.

  • hex (integer or iterable, optional) – Number of assembly, by default None.

  • leglabels (list, optional) – List of strings for the legend entries, by default None

  • figname (string, optional) – Name of the figure to be saved, including its format, by default None

  • xlabel (str, optional) – Label for the x-axis, by default None

  • xlims (list, optional) – Limits on the x-axis, by default None

  • ylims (list, optional) – Limits on the y-axis, by default None

  • ylabel (str, optional) – Label for the y-axis, by default None

  • autolabel (str, optional) – Flag to generate automatically the legend label, by default True

  • style (str, optional) – Path of the matplotlib style, by default sty1D.mplstyle

  • legend (bool, optional) – Option to print the legend, by default True

Raises:
  • THoutputError – If the tools path in the coreutils directory is not found.

  • THoutputError – _description_