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
.jsoninput 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.
- 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.
- 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
Truein order to print also capture, nubar and scattering production data, by defaultFalseinf (bool, optional) – Set to
Falseto get B1 Serpent calculation mode for the multi-group constants, by defaultTruetxtfmt (bool, optional) – Set to
Trueto print data also in .txt format, by defaultFalse
- 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:
IndexError – DESCRIPTION.
TypeError – DESCRIPTION.
- 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.
- core
Object representing the core of the FRENETIC simulation.
- Type:
- 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:
- distributions
List of
strwith the names of the Distributions (e.g., the coolant temperature).- Type:
- 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
Falsefigname (string, optional) – Name of the figure to be saved, with its extension, by default
Nonehex (list, optional) – List of assemblies to be plotted, by default
Noneusetex (bool, optional) – Boolean for LaTeX string formatting, by default
Falsefill (bool, optional) – Bool to fill the patch with colours, by default
Trueaxes (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
NonecbarLabel (bool, optional) – Boolean for the label of the colorbar, by default
Truexlabel (string, optional) – Label of the x-axis, by default
Noneylabel (string, optional) – Label of the y-axis, by default
Nonelog (bool, optional) – Boolean for a log scale, by default
Nonetitle (bool, optional) – Boolean for the plot title, by default
Truescale (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:
- 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
Nonez (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
Nonefigname (string, optional) – Name of the figure to be saved, including its format, by default
Nonexlabel (str, optional) – Label for the x-axis, by default
Nonexlims (list, optional) – Limits on the x-axis, by default
Noneylims (list, optional) – Limits on the y-axis, by default
Noneylabel (str, optional) – Label for the y-axis, by default
Noneautolabel (str, optional) – Flag to generate automatically the legend label, by default
Truestyle (str, optional) – Path of the matplotlib style, by default
sty1D.mplstylelegend (bool, optional) – Option to print the legend, by default
True
- Raises:
THoutputError – If the
toolspath in thecoreutilsdirectory is not found.THoutputError – _description_