A monte carlo pin cell spectral code for nuclear engineering applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pinspec.process Namespace Reference

The process module provides utility functions to retrieve data from PINSPEC's C++ classes, in particular, tally data. More...

Classes

class  RIEff
 An effective resonance integral. More...
 
class  RITrue
 A true resonance integral. More...
 
class  GroupXS
 A multi-group cross-section for a certain reaction rate. More...
 

Functions

def getTallyCenters
 Returns an array of the center values for a tally's bins. More...
 
def getTallyEdges
 Returns an array of the bin edge values for a tally's bins. More...
 
def getTallyBatchMu
 Returns an array of the batch averages for the tally's bins. More...
 
def getTallyBatchVariances
 Returns an array of the batch variances for a tally's bins. More...
 
def getTallyBatchStdDev
 Returns an array of the batch standard deviations for a tally's bins. More...
 
def getTallyBatchRelErr
 Returns an array of the batch relative errors for a tally's bins. More...
 
def getTallyBatchStatistics
 Returns a 2D array of the tally's batch statistics. More...
 
def printTallies
 Prints formatted tally batch-averaged data to the screen as a table. More...
 
def computeMeanNumCollisions
 Computes the mean number of collisions for a neutron before absorption. More...
 
def computeMeanNeutronLifetime
 Computes the mean neutron lifetime (seconds) before absorption. More...
 
def printRIs
 Prints a formatted table for an array of true and/or effectrive resonance integrals to the screen. More...
 

Detailed Description

The process module provides utility functions to retrieve data from PINSPEC's C++ classes, in particular, tally data.

In addition, the process module includes routines to use tallies to compute resonance integrals and group cross-sections and to print the results to the screen.

Author
William Boyd (wboyd.nosp@m.@mit.nosp@m..edu)
Samuel Shaner (shane.nosp@m.r@mi.nosp@m.t.edu)
Date
March 25, 2013

Function Documentation

def pinspec.process.computeMeanNeutronLifetime (   coll_times,
  num_neutrons 
)

Computes the mean neutron lifetime (seconds) before absorption.

Parameters
coll_timesINTERCOLLISION_TIME tally
num_neutronsthe number of neutrons per batch
Returns
the mean neutron lifetime (seconds) before absoprtion
def pinspec.process.computeMeanNumCollisions (   coll_rate,
  num_neutrons 
)

Computes the mean number of collisions for a neutron before absorption.

Parameters
coll_ratea COLLISION_RATE tally
num_neutronsthe number of neutrons per batch
Returns
the mean number of collisions per neutron before absorption
def pinspec.process.getTallyBatchMu (   tally)

Returns an array of the batch averages for the tally's bins.

A wrapper function to make it easier to access a tally's tallies data array through SWIG. This would be invoked a PINSPEC Python input file as follows:

1 tally_averages = pinspec.process.getTallyBatchMu(tally)
Parameters
tallythe tally of interest
Returns
a numpy array with the tally batch averages
def pinspec.process.getTallyBatchRelErr (   tally)

Returns an array of the batch relative errors for a tally's bins.

A wrapper function to make it easier to access a tally's relative errors data array through SWIG. This would be invoked a PINSPEC Python input file as follows:

1 tally_rel_err = pinspec.process.getTallyBatchRelErr(tally)
Parameters
tallythe tally of interest
Returns
a numpy array with the tally batch relative errors
def pinspec.process.getTallyBatchStatistics (   tally)

Returns a 2D array of the tally's batch statistics.

This is a wrapper function to make it easier to access a tally's batch-based statistical data through SWIG. The array returned contains the tally bin centers, averages, variances, standard deviations, and relative errors, in that order. This would be invoked a PINSPEC Python input file as follows:

2 bin_centers = tally_data[0][:]
3 tally_avareages = tally_data[1][:]
4 tally_variances = tally_data[2][:]
5 tally_std_dev = tally_data[3][:]
6 tally_rel_err = tally_data[4][:]
Parameters
tallythe tally of interest
Returns
a 2D numpy array with the tally batch statistical data
def pinspec.process.getTallyBatchStdDev (   tally)

Returns an array of the batch standard deviations for a tally's bins.

A wrapper function to make it easier to access a tally's standard deviations data array through SWIG. This would be invoked a PINSPEC Python input file as follows:

1 tally_std_dev = pinspec.process.getTallyBatchStdDev(tally)
Parameters
tallythe tally of interest
Returns
a numpy array with the tally batch standard deviations
def pinspec.process.getTallyBatchVariances (   tally)

Returns an array of the batch variances for a tally's bins.

A wrapper function to make it easier to access a tally's variances data array through SWIG. This would be invoked a PINSPEC Python input file as follows:

1 tally_variances = pinspec.process.getTallyBatchVariances(tally)
Parameters
tallythe tally of interest
Returns
a numpy array with the tally batch variances
def pinspec.process.getTallyCenters (   tally)

Returns an array of the center values for a tally's bins.

A wrapper function to make it easier to access a tally's bin center data array through SWIG. This would be invoked a PINSPEC Python input file as follows:

1 bin_center_array = pinspec.process.getTallyCenters(tally)
Parameters
tallythe tally of interest
Returns
a numpy array with the tally bin centers
def pinspec.process.getTallyEdges (   tally)

Returns an array of the bin edge values for a tally's bins.

A wrapper function to make it easier to access a tally's bin edges data array through SWIG. This would be invoked a PINSPEC Python input file as follows:

1 bin_edges_array = pinspec.process.getTallyEdges(tally)
Parameters
tallythe tally of interest
Returns
a numpy array with the tally bin edges
def pinspec.process.printRIs (   RIs,
  header = '' 
)

Prints a formatted table for an array of true and/or effectrive resonance integrals to the screen.

Parameters
RIsa list of resonance integrals (RIEff or RITrue objects)
headeran optional argument string for the table title
def pinspec.process.printTallies (   tallies,
  header = '',
  types = 'Tallies' 
)

Prints formatted tally batch-averaged data to the screen as a table.

Prints a formatted table of tally data to the screen and can be used for a single tally or for a list of tallies. Since RIEff objects are simply Python wrappers for an underlying DERIVED type tally, this method can also be used to print lists of RIEff objects. It also works for RITrue objects, though RITrue objects are not stored as tallies. A user may invoke this function from a PINSPEC Python input file as follows:

1 printTallies([flux1, flux2, flux3], header='Flux Tallies')
Parameters
talliesa list of the tallies to print to the screen
headeran optional string to prepend to the title of table.
typesan optional string of the tally types for the table title