bluemira.codes.openmc.output

Functions to present the results prettily (Including both printed/logged texts and images)

Classes

OpenMCResultBase

Base class for openmc results

OpenMCCSGResult

Class that looks opens up the openmc universe from the statepoint file,

OpenMCDAGMCResult

Open up the openmc universe from the statepoint file,

NeutronicsOutputParams

Neutronics output parameters

Functions

_get_std_dev_iloc(df)

_get_std_dev_numpy(df)

get_percent_err(row)

Calculate a percentage error to the required row,

Module Contents

bluemira.codes.openmc.output._get_std_dev_iloc(df)
bluemira.codes.openmc.output._get_std_dev_numpy(df)
bluemira.codes.openmc.output.get_percent_err(row)

Calculate a percentage error to the required row, assuming cells had been filled out.

Parameters:

row (pd.Series object) – It should have the “mean” and “std. dev.” row[‘mean’]: float row[‘std. dev.’]: float

Returns:

  • fractional_error (float)

  • Usage

  • —–

  • dataframe.apply(get_percent_err),

  • where dataframe must have one row named “std. dev.” and another named “mean”.

class bluemira.codes.openmc.output.OpenMCResultBase

Base class for openmc results

static _load_dataframe_from_statepoint(statepoint: openmc.StatePoint, tally_name: str) pandas.DataFrame
Parameters:
  • statepoint (openmc.StatePoint)

  • tally_name (str)

Return type:

pandas.DataFrame

static _convert_dict_contents(dataset: dict[str, dict[int, list[str | float]]])
Parameters:

dataset (dict[str, dict[int, list[str | float]]])

static dt_neuton_power(src_triton_rate)

Calculate dt neutron power

static energy_multiplication(dt_neutron_power, total_power)

Calculate energy multiplication

static multiplication_power(energy_multiplication, dt_neutron_power)

Calculate multiplication power

classmethod _load_filter_power_err(statepoint, src_rate: float, filter_name: str) tuple[float, float]

Power is initially loaded as eV/source particle. To convert to Watt, we need the source particle rate.

Parameters:
  • filter_name (str) – the literal name that was used in tallying.py to refer to this tally.

  • src_rate (float) – source particle rate.

Returns:

  • power – The total power [W].

  • errors – The absolute error on the total power [W]. RMS of errors from each cell.

Return type:

tuple[float, float]

classmethod _load_tbr(statepoint, source_rate: float, source_triton_rate: float)

Load the TBR value and uncertainty.

Returns:

  • mean – average TBR, i.e. average (n,Xt) per source particle.

  • error – absolute error, but since the table is only 1 row long, we can turn the array into a float by .sum().

Parameters:
  • source_rate (float)

  • source_triton_rate (float)

class bluemira.codes.openmc.output.OpenMCCSGResult

Bases: OpenMCResultBase

Inheritance diagram of bluemira.codes.openmc.output.OpenMCCSGResult

Class that looks opens up the openmc universe from the statepoint file,

so that the dataframes containing the relevant results can be generated and reformatted by its methods.

tbr: float
tbr_err: float
e_mult: float
e_mult_err: float
heating: dict
blanket_power: float
blanket_power_err: float
divertor_power: float
divertor_power_err: float
vessel_power: float
vessel_power_err: float
total_power: float
total_power_err: float
mult_power: float
peak_bb_fe_damage: float
peak_bb_fe_damage_err: float
fluxes: dict
damage: dict
photon_heat_flux: dict

Photon heat flux

universe: openmc.Universe
cell_arrays: bluemira.codes.openmc.make_csg.CellStage
src_rate: float
statepoint: openmc.StatePoint
statepoint_file: str
cell_names: dict
cell_vols: dict
mat_names: dict
classmethod from_run(universe: openmc.Universe, cell_arrays: bluemira.codes.openmc.make_csg.CellStage, src_rate: float, src_triton_rate: float, statepoint_file: pathlib.Path)

Create results class from run statepoint

Parameters:
static _load_volume_calculation_from_file(volume_file_path: pathlib.Path, cell_names: list[str])

Load the volume file to record as volume information.

Parameters:
  • volume_file_path (pathlib.Path) – filepath to volume

  • cell_names (list[str]) – indicative names to print.

classmethod _load_heating(statepoint, mat_names, src_rate)

Load the heating (sorted by material) dataframe

classmethod _load_fluxes(statepoint, cell_names, cell_vols, src_rate)

Load the neutron fluxes dataframe.

classmethod _load_damage(statepoint, cell_names, cell_vols, cell_arrays, src_rate)

Load the damage-energy tally dataframe, post-process them until we get: - Fe damage rate for the FW - Fe damage rate behind the FW - Cu damage rate in the divertor - Fe damage rate in the VV

static _add_dpa_column(df, dpa_threshold_eV)

Add the data for number of atoms and number of displacements, which are then used to calculate the DPA/FPY.

classmethod _load_photon_heat_flux(statepoint, cell_names, cell_vols, src_rate)

Load the photon heaat flux dataframe

__str__()

String representation

static _tabulate(records: dict[str, str | float], tablefmt: str = 'fancy_grid', floatfmt: str = '.3g') str
Parameters:
  • records (dict[str, str | float])

  • tablefmt (str)

  • floatfmt (str)

Return type:

str

class bluemira.codes.openmc.output.OpenMCDAGMCResult

Bases: OpenMCResultBase

Inheritance diagram of bluemira.codes.openmc.output.OpenMCDAGMCResult

Open up the openmc universe from the statepoint file, so that the dataframes containing the relevant results can be generated and reformatted by its methods.

tbr: float
tbr_err: float
e_mult: float
e_mult_err: float
mult_power: float
src_rate: float
statepoint: openmc.StatePoint
statepoint_file: pathlib.Path
classmethod from_run(universe: openmc.Universe, src_rate: float, src_triton_rate: float, statepoint_file: pathlib.Path)

Create results class from run statepoint

Parameters:
  • universe (openmc.Universe)

  • src_rate (float)

  • src_triton_rate (float)

  • statepoint_file (pathlib.Path)

class bluemira.codes.openmc.output.NeutronicsOutputParams

Bases: bluemira.base.parameter_frame._frame.ParameterFrame

Inheritance diagram of bluemira.codes.openmc.output.NeutronicsOutputParams

Neutronics output parameters

e_mult: bluemira.base.parameter_frame._parameter.Parameter[float]
TBR: bluemira.base.parameter_frame._parameter.Parameter[float]
P_n_blanket: bluemira.base.parameter_frame._parameter.Parameter[float]
P_n_divertor: bluemira.base.parameter_frame._parameter.Parameter[float]
P_n_vessel: bluemira.base.parameter_frame._parameter.Parameter[float]
P_n_aux: bluemira.base.parameter_frame._parameter.Parameter[float]
P_n_e_mult: bluemira.base.parameter_frame._parameter.Parameter[float]
P_n_decay: bluemira.base.parameter_frame._parameter.Parameter[float]
peak_eurofer_dpa_rate: bluemira.base.parameter_frame._parameter.Parameter[float]
peak_bb_iron_dpa_rate: bluemira.base.parameter_frame._parameter.Parameter[float]
peak_vv_iron_dpa_rate: bluemira.base.parameter_frame._parameter.Parameter[float]
peak_div_cu_dpa_rate: bluemira.base.parameter_frame._parameter.Parameter[float]
classmethod from_openmc_dag_result(result: OpenMCDAGMCResult)

Produce output parameters from an OpenMC DAGMC result

Parameters:

result (OpenMCDAGMCResult)

classmethod from_openmc_csg_result(result: OpenMCCSGResult)

Produce output parameters from an OpenMC CSG result

Parameters:

result (OpenMCCSGResult)

classmethod from_0d_result(result: bluemira.radiation_transport.neutronics.zero_d_neutronics.ZeroDNeutronicsResult)

Produce output parameters from simplified 0-D neutronics model

Parameters:

result (bluemira.radiation_transport.neutronics.zero_d_neutronics.ZeroDNeutronicsResult)