Mesh-based Rigourous 2-Step Activation – pyne.r2s

This module contains functions for mesh-based Rigorous 2-Step activation [1] using MCNP for neutron and photon transport and ALARA for nuclear inventory analysis. The functionality of the module can be obtained by importing as such:

from pyne import r2s

[1] CHEN and U. FISCHER, “Rigorous MCNP Based Shutdown Dose Rate Calculations: Computational Scheme, Verification Calculations and Application to ITER,” Fusion Engineering and Design, 63-64, 107–114 (2002).

Rigorous 2-Step Activation API

pyne.r2s.irradiation_setup(flux_mesh, cell_mats, cell_fracs, alara_params, tally_num=4, num_rays=10, grid=False, flux_tag='n_flux', fluxin='alara_fluxin', reverse=False, alara_inp='alara_inp', alara_matlib='alara_matlib', output_mesh='r2s_step1.h5m', output_material=False, decay_times=None, sub_voxel=False, responses=None, wdr_file=None)[source]

This function is used to setup the irradiation inputs after the first R2S transport step.

Parameters
flux_meshPyNE Meshtal object, Mesh object, or str

The source of the neutron flux information. This can be a PyNE Meshtal object, a pyne Mesh object, or the filename an MCNP meshtal file, or the filename of an unstructured mesh tagged with fluxes.

cell_matsdict

Maps geometry cell numbers to PyNE Material objects.

cell_fracsrecord array

The output of dagmc.discretize_geom().

alara_paramsstr

The ALARA input blocks specifying everything except the geometry and materials. This can either be passed as string or as a file name.

tally_numint

The MCNP FMESH4 tally number of the neutron flux tally within the meshtal file.

num_raysint, optional

The number of rays to fire down a mesh row for geometry discretization. This number must be a perfect square if grid=True.

gridbool, optional

The if False, geometry discretization will be done with randomly fired rays. If true, a grid of sqrt(num_rays) x sqrt(num_rays) rays is used for each mesh row.

flux_tagstr, optional

The mesh tag for the neutron flux.

fluxinstr, optional

The name of the ALARA fluxin file to be created.

reversebool, optional

If True the fluxes in the fluxin file will be printed in the reverse order of how they appear within the flux vector tag. Since MCNP and the Meshtal class order fluxes from low energy to high energy, this option should only be true if the transmutation data being used is ordered from high energy to low energy.

alara_inpstr, optional

The name of the ALARA input file to be created.

alara_matlibstr, optional

The name of the alara_matlib file to be created.

output_meshstr, optional

A mesh containing all the fluxes and materials used for irradiation setup.

output_materialbool, optional

If true, output mesh will have materials as determined by dagmc.discretize_geom()

decay_times: list

List of the decay times. If no decay times given, use ‘1 s’.

sub_voxelbool, optional

If true, sub-voxel r2s work flow will be used.

responseslist of str, optional

The list of requested responses.

wdr_filestr

Path to the wdr file.

pyne.r2s.photon_sampling_setup(mesh, phtn_src, tags)[source]

This function reads in an ALARA photon source file and creates and tags photon source densities onto a Mesh object for the second R2S transport step.

Parameters
meshPyNE Mesh

The object containing the mesh instance to be tagged.

phtn_srcstr

The path of the ALARA phtn_file.

tags: dict

A dictionary were the keys are tuples with two values. The first is a string denoting an nuclide in any form that is understood by pyne.nucname (e.g. ‘1001’, ‘U-235’, ‘242Am’) or ‘TOTAL’ for all nuclides. The second is a string denoting the decay time as it appears in the phtn_src file (e.g. ‘shutdown’, ‘1 h’ ‘3 d’). The values of the dictionary are the requested tag names for the combination of nuclide and decay time. These tag names should be the tag names that are read by the sampling subroutine. For example:

tags = {(‘U-235’, ‘shutdown’): ‘tag1’, (‘TOTAL’, ‘1 h’): ‘tag2’}

pyne.r2s.resolve_mesh(mesh_reference, tally_num=None, flux_tag='n_flux', output_material=False)[source]
This function creates a method that will consume many mesh-like objects

(e.g. mesh, an h5m file, a meshtal file, etc) and returns a robust PyNE mesh object accordingly.

Parameters
mesh_referenceMesh object, unstructured mesh file, Meshtal, meshtal

file, or PyNE Meshtal object.

The source of the neutron flux information. This can be a PyNE Meshtal object, a pyne Mesh object, or the filename an MCNP meshtal file, or the filename of an unstructured mesh tagged with fluxes.

tally_numint

The MCNP FMESH4 tally number of the neutron flux tally within the meshtal file.

flux_tagstr, optional

The tag name for the neutron flux.

output_materialbool, optional

If true, output mesh will have materials as determined by dagmc.discretize_geom().

Returns
mPyNE mesh object

The PyNE mesh object of the flux data.

pyne.r2s.total_photon_source_intensity(m, tag_name, sub_voxel=False)[source]

This function reads mesh tagged with photon source densities and returns the total photon emission desinty.

Parameters
mPyNE Mesh

The mesh-based photon emission density distribution in p/cm3/s.

tag_namestr

The name of the tag on the mesh with the photon emission density information.

sub_voxel: bool, optional

If true, sub-voxel r2s work flow will be used.

Returns
intensityfloat

The total photon emission density across the entire mesh (p/s).