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

A multi-group cross-section for a certain reaction rate. More...

#include "pinspec/process.py"

Inheritance diagram for pinspec.process.GroupXS:

Public Member Functions

def __init__
 The group cross-section constructor. More...
 
def computeGroupXS
 Computes the multigroup cross-sections from the two tallies. More...
 
def setName
 Sets the name of this group cross-section. More...
 
def getName
 Returns the name of the GroupXS object. More...
 
def getNumXS
 Returns the number of multi-group cross-section values. More...
 
def getXS
 Retrurns an array of the batch-averaged multi-group cross-sections. More...
 
def getVariances
 Returns an array of the multi-group cross-section variances. More...
 
def getStandardDeviation
 Returns an array of the multi-group cross-section standard deviations. More...
 
def getRelativeError
 Returns an array of the multi-group cross-section relative errors. More...
 
def getEnergyBandsCenters
 Returns an array of the multi-group cross-section energy band centers. More...
 
def getEnergyBands
 Returns an array of the multi-group cross-section energy band values. More...
 
def getGroupXS
 Returns a reference to this GroupXS object. More...
 
def printXS
 Prints a formatted table of the multi-group cross-sections to the screen. More...
 
def outputXStoFile
 Prints the multi-group cross-section data and batch statistics to a file. More...
 
def __add__
 Create a new GroupXS from this one and add a scalar value, tally, or another GroupXS to it. More...
 
def __sub__
 Create a new GroupXS from this one and subtract a scalar value, tally, or another GroupXS from it. More...
 
def __mul__
 Create a new GroupXS from this one and multiply a scalar value, tally, or another GroupXS to it. More...
 
def __div__
 Create a new GroupXS from this one and divide a scalar value, tally, or another GroupXS from it. More...
 

Private Attributes

 _name
 The name of the multi-group cross-section.
 
 _xs
 The DERIVED tally used to store the multi-group cross-sections.
 
 _flux
 The pinspec.FLUX tally used to compute the multi-group cross-sections.
 
 _rate
 The REACTION_RATE tally used to compute the multi-group cross-sections.
 
 _num_xs
 The number of multi-group cross-sections.
 

Detailed Description

A multi-group cross-section for a certain reaction rate.

This class represents a multi-group cross-section with some energy bands for a certain reaction rate. By default, the group cross-section is a macroscopic cross-section $ (cm^{-1}) $.

Constructor & Destructor Documentation

def pinspec.process.GroupXS.__init__ (   self,
  tally1,
  tally2,
  name = '' 
)

The group cross-section constructor.

Parameters
selfthe GroupXS object pointer
tally1one of the tallies needed to compute a multi-group cross-section
tally2one of the tallies needed to compute a multi-group cross-section
namean optional argument string for the name of the multi-group cross-section

Member Function Documentation

def pinspec.process.GroupXS.__add__ (   self,
  x 
)

Create a new GroupXS from this one and add a scalar value, tally, or another GroupXS to it.

Parameters
xthe item to add to the GroupXS
Returns
the GroupXS with the value added to it
def pinspec.process.GroupXS.__div__ (   self,
  x 
)

Create a new GroupXS from this one and divide a scalar value, tally, or another GroupXS from it.

Parameters
xthe item to divide from the GroupXS
Returns
the GroupXS with the value divided from it
def pinspec.process.GroupXS.__mul__ (   self,
  x 
)

Create a new GroupXS from this one and multiply a scalar value, tally, or another GroupXS to it.

Parameters
xthe item to multiply with the GroupXS
Returns
the GroupXS with the value multiplied to it
def pinspec.process.GroupXS.__sub__ (   self,
  x 
)

Create a new GroupXS from this one and subtract a scalar value, tally, or another GroupXS from it.

Parameters
xthe item to subtract from the GroupXS
Returns
the GroupXS with the value subtracted from it
def pinspec.process.GroupXS.computeGroupXS (   self,
  tally1,
  tally2 
)

Computes the multigroup cross-sections from the two tallies.

This method checks that one of the tallies input is a reaction rate and the other is a flux, with the same bin edges. If the batch statistics for both tallies have been computed, it computes the multigroup cross-section as follows:

1 sigma_groups = reaction_rate / flux
Parameters
selfthe GroupXS object pointer
tally1one of the tallies needed to compute a multi-group cross-section
tally2one of the tallies needed to compute a multi-group cross-section
def pinspec.process.GroupXS.getEnergyBands (   self)

Returns an array of the multi-group cross-section energy band values.

Parameters
selfthe GroupXS object pointer
Returns
a numpy array of the multi-group cross-section energy band values
def pinspec.process.GroupXS.getEnergyBandsCenters (   self)

Returns an array of the multi-group cross-section energy band centers.

Parameters
selfthe GroupXS object pointer
Returns
a numpy array of the multi-group cross-section energy band centers
def pinspec.process.GroupXS.getGroupXS (   self)

Returns a reference to this GroupXS object.

Parameters
selfGroupXS the object pointer
Returns
a reference to the GroupXS object
def pinspec.process.GroupXS.getName (   self)

Returns the name of the GroupXS object.

Returns an empty string if no name has been specified by the user.

Parameters
selfthe GroupXS object pointer
Returns
a string with the name of the GroupXS
def pinspec.process.GroupXS.getNumXS (   self)

Returns the number of multi-group cross-section values.

Parameters
selfthe GroupXS object pointer
Returns
the number of multi-group cross-section values
def pinspec.process.GroupXS.getRelativeError (   self)

Returns an array of the multi-group cross-section relative errors.

Parameters
selfthe GroupXS object pointer
Returns
a numpy array of the multi-group cross-section relative errors
def pinspec.process.GroupXS.getStandardDeviation (   self)

Returns an array of the multi-group cross-section standard deviations.

Parameters
selfthe GroupXS object pointer
Returns
a numpy array of the multi-group cross-section standard deviations
def pinspec.process.GroupXS.getVariances (   self)

Returns an array of the multi-group cross-section variances.

Parameters
selfthe GroupXS object pointer
Returns
a numpy array of the multi-group cross-section variances
def pinspec.process.GroupXS.getXS (   self)

Retrurns an array of the batch-averaged multi-group cross-sections.

Parameters
selfthe GroupXS object pointer
Returns
a numpy array of the multi-group cross-sections
def pinspec.process.GroupXS.outputXStoFile (   self,
  filename = '' 
)

Prints the multi-group cross-section data and batch statistics to a file.

Since the multi-group cross-sections are stored as a DERIVED tally type, this method prints the cross-section data to a file using the Tally::outputBatchStatistics() method. An auto-generated filename will be created with the format 'tally-#.data' where # is an auto-incremented integer for each tally output data file created.

Parameters
selfthe GroupXS object pointer
filenameAn optional filename for the output file
def pinspec.process.GroupXS.printXS (   self,
  uncertainties = False 
)

Prints a formatted table of the multi-group cross-sections to the screen.

The multi-group cross-sections and their uncertainties (optional) will be printed as a formatted table to the screen.

Parameters
selfthe GroupXS object pointer
uncertaintieswhether or not to print tally statistics (default is false)
Returns
a reference to the GroupXS object
def pinspec.process.GroupXS.setName (   self,
  name = '' 
)

Sets the name of this group cross-section.

This is useful when one wishes to print the multi-group cross-section values to the screen or a file since it will be identifiable by the user-defined name.

Parameters
selfthe GroupXS object pointer
namethe name of the GroupXS object

The documentation for this class was generated from the following file: