bluemira.codes.openmc.output ============================ .. py:module:: bluemira.codes.openmc.output .. autoapi-nested-parse:: Functions to present the results prettily (Including both printed/logged texts and images) Classes ------- .. autoapisummary:: bluemira.codes.openmc.output.OpenMCResultBase bluemira.codes.openmc.output.OpenMCCSGResult bluemira.codes.openmc.output.OpenMCDAGMCResult bluemira.codes.openmc.output.NeutronicsOutputParams Functions --------- .. autoapisummary:: bluemira.codes.openmc.output._get_std_dev_iloc bluemira.codes.openmc.output._get_std_dev_numpy bluemira.codes.openmc.output.get_percent_err Module Contents --------------- .. py:function:: _get_std_dev_iloc(df) .. py:function:: _get_std_dev_numpy(df) .. py:function:: get_percent_err(row) Calculate a percentage error to the required row, assuming cells had been filled out. :param row: It should have the "mean" and "std. dev." row['mean']: float row['std. dev.']: float :type row: pd.Series object :returns: * **fractional_error** (*float*) * *Usage* * *-----* * *dataframe.apply(get_percent_err),* * *where dataframe must have one row named "std. dev." and another named "mean".* .. py:class:: OpenMCResultBase Base class for openmc results .. py:method:: _load_dataframe_from_statepoint(statepoint: openmc.StatePoint, tally_name: str) -> pandas.DataFrame :staticmethod: .. py:method:: _convert_dict_contents(dataset: dict[str, dict[int, list[str | float]]]) :staticmethod: .. py:method:: dt_neuton_power(src_triton_rate) :staticmethod: Calculate dt neutron power .. py:method:: energy_multiplication(dt_neutron_power, total_power) :staticmethod: Calculate energy multiplication .. py:method:: multiplication_power(energy_multiplication, dt_neutron_power) :staticmethod: Calculate multiplication power .. py:method:: _load_filter_power_err(statepoint, src_rate: float, filter_name: str) -> tuple[float, float] :classmethod: Power is initially loaded as eV/source particle. To convert to Watt, we need the source particle rate. :param filter_name: the literal name that was used in tallying.py to refer to this tally. :param src_rate: source particle rate. :returns: * *power* -- The total power [W]. * *errors* -- The absolute error on the total power [W]. RMS of errors from each cell. .. py:method:: _load_tbr(statepoint, source_rate: float, source_triton_rate: float) :classmethod: 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(). .. py:class:: OpenMCCSGResult Bases: :py:obj:`OpenMCResultBase` .. autoapi-inheritance-diagram:: bluemira.codes.openmc.output.OpenMCCSGResult :parts: 1 :private-bases: 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. .. py:attribute:: tbr :type: float .. py:attribute:: tbr_err :type: float .. py:attribute:: e_mult :type: float .. py:attribute:: e_mult_err :type: float .. py:attribute:: heating :type: dict .. py:attribute:: blanket_power :type: float .. py:attribute:: blanket_power_err :type: float .. py:attribute:: divertor_power :type: float .. py:attribute:: divertor_power_err :type: float .. py:attribute:: vessel_power :type: float .. py:attribute:: vessel_power_err :type: float .. py:attribute:: total_power :type: float .. py:attribute:: total_power_err :type: float .. py:attribute:: mult_power :type: float .. py:attribute:: peak_bb_fe_damage :type: float .. py:attribute:: peak_bb_fe_damage_err :type: float .. py:attribute:: fluxes :type: dict .. py:attribute:: damage :type: dict .. py:attribute:: photon_heat_flux :type: dict Photon heat flux .. py:attribute:: universe :type: openmc.Universe .. py:attribute:: cell_arrays :type: bluemira.codes.openmc.make_csg.CellStage .. py:attribute:: src_rate :type: float .. py:attribute:: statepoint :type: openmc.StatePoint .. py:attribute:: statepoint_file :type: str .. py:attribute:: cell_names :type: dict .. py:attribute:: cell_vols :type: dict .. py:attribute:: mat_names :type: dict .. py:method:: from_run(universe: openmc.Universe, cell_arrays: bluemira.codes.openmc.make_csg.CellStage, src_rate: float, src_triton_rate: float, statepoint_file: pathlib.Path) :classmethod: Create results class from run statepoint .. py:method:: _load_volume_calculation_from_file(volume_file_path: pathlib.Path, cell_names: list[str]) :staticmethod: Load the volume file to record as volume information. :param volume_file_path: filepath to volume :param cell_names: indicative names to print. .. py:method:: _load_heating(statepoint, mat_names, src_rate) :classmethod: Load the heating (sorted by material) dataframe .. py:method:: _load_fluxes(statepoint, cell_names, cell_vols, src_rate) :classmethod: Load the neutron fluxes dataframe. .. py:method:: _load_damage(statepoint, cell_names, cell_vols, cell_arrays, src_rate) :classmethod: 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 .. py:method:: _add_dpa_column(df, dpa_threshold_eV) :staticmethod: Add the data for number of atoms and number of displacements, which are then used to calculate the DPA/FPY. .. py:method:: _load_photon_heat_flux(statepoint, cell_names, cell_vols, src_rate) :classmethod: Load the photon heaat flux dataframe .. py:method:: __str__() String representation .. py:method:: _tabulate(records: dict[str, str | float], tablefmt: str = 'fancy_grid', floatfmt: str = '.3g') -> str :staticmethod: .. py:class:: OpenMCDAGMCResult Bases: :py:obj:`OpenMCResultBase` .. autoapi-inheritance-diagram:: bluemira.codes.openmc.output.OpenMCDAGMCResult :parts: 1 :private-bases: 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. .. py:attribute:: tbr :type: float .. py:attribute:: tbr_err :type: float .. py:attribute:: e_mult :type: float .. py:attribute:: e_mult_err :type: float .. py:attribute:: mult_power :type: float .. py:attribute:: src_rate :type: float .. py:attribute:: statepoint :type: openmc.StatePoint .. py:attribute:: statepoint_file :type: pathlib.Path .. py:method:: from_run(universe: openmc.Universe, src_rate: float, src_triton_rate: float, statepoint_file: pathlib.Path) :classmethod: Create results class from run statepoint .. py:class:: NeutronicsOutputParams Bases: :py:obj:`bluemira.base.parameter_frame._frame.ParameterFrame` .. autoapi-inheritance-diagram:: bluemira.codes.openmc.output.NeutronicsOutputParams :parts: 1 :private-bases: Neutronics output parameters .. py:attribute:: e_mult :type: bluemira.base.parameter_frame._parameter.Parameter[float] .. py:attribute:: TBR :type: bluemira.base.parameter_frame._parameter.Parameter[float] .. py:attribute:: P_n_blanket :type: bluemira.base.parameter_frame._parameter.Parameter[float] .. py:attribute:: P_n_divertor :type: bluemira.base.parameter_frame._parameter.Parameter[float] .. py:attribute:: P_n_vessel :type: bluemira.base.parameter_frame._parameter.Parameter[float] .. py:attribute:: P_n_aux :type: bluemira.base.parameter_frame._parameter.Parameter[float] .. py:attribute:: P_n_e_mult :type: bluemira.base.parameter_frame._parameter.Parameter[float] .. py:attribute:: P_n_decay :type: bluemira.base.parameter_frame._parameter.Parameter[float] .. py:attribute:: peak_eurofer_dpa_rate :type: bluemira.base.parameter_frame._parameter.Parameter[float] .. py:attribute:: peak_bb_iron_dpa_rate :type: bluemira.base.parameter_frame._parameter.Parameter[float] .. py:attribute:: peak_vv_iron_dpa_rate :type: bluemira.base.parameter_frame._parameter.Parameter[float] .. py:attribute:: peak_div_cu_dpa_rate :type: bluemira.base.parameter_frame._parameter.Parameter[float] .. py:method:: from_openmc_dag_result(result: OpenMCDAGMCResult) :classmethod: Produce output parameters from an OpenMC DAGMC result .. py:method:: from_openmc_csg_result(result: OpenMCCSGResult) :classmethod: Produce output parameters from an OpenMC CSG result .. py:method:: from_0d_result(result: bluemira.radiation_transport.neutronics.zero_d_neutronics.ZeroDNeutronicsResult) :classmethod: Produce output parameters from simplified 0-D neutronics model