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, alara_params, tally_num=4, geom=None, num_rays=10, grid=False, flux_tag='n_flux', fluxin='alara_fluxin', reverse=False, alara_inp='alara_geom', alara_matlib='alara_matlib', output_mesh='r2s_step1.h5m', output_material=False, sub_voxel=False)[source]

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


flux_mesh : PyNE 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.

tally_num : int

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

cell_mats : dict

Maps geometry cell numbers to PyNE Material objects.

alara_params : str

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

geom : str, optional

The file name of a DAGMC-loadable faceted geometry. This is only necessary if the geometry is not already loaded into memory.

num_rays : int, optional

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

grid : bool, 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_tag : str, optional

The iMesh tag for the neutron flux.

fluxin : str, optional

The name of the ALARA fluxin file to be created.

reverse : bool, 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_inp : str, optional

The name of the ALARA input file to be created.

alara_matlib : str, optional

The name of the alara_matlib file to be created.

output_mesh : str, optional

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

output_material : bool, optional

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

sub_voxel : bool, optional

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

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.


mesh : PyNE Mesh

The object containing the iMesh instance to be tagged.

phtn_src : str

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.total_photon_source_intensity(m, tag_name)[source]

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


m : PyNE Mesh

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

tag_name : str

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


intensity : float

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