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

The Fissioner represents the physics of fission neutron emission. More...

#include "pinspec/src/Fissioner.h"

Public Member Functions

 Fissioner ()
 Default Fissioner constructor. More...
 
virtual ~Fissioner ()
 Fissioner destructor deallocates memory for CDF arrays.
 
int getNumBins ()
 Returns the number of bins that the Fissioner uses for the CDF. More...
 
void setNumBins (int num_bins)
 Sets the number of bins that we wish to use for the CDF. More...
 
void setEMax (float E_max)
 Sets the maximum energy value for the CDF. More...
 
void buildCDF ()
 Builds the CDF of the Watt Spectrum.
 
float wattSpectrum (float energy)
 Returns the chi value for a given energy from the Watt spectrum. More...
 
float emitNeutronMeV ()
 Sample the Fissioner's CDF and return a neutron energy from fission. More...
 
float emitNeutroneV ()
 Sample the Fissioner's CDF and return a neutron energy from fission. More...
 
void retrieveCDF (float *cdf, int num_bins)
 Fills an input array with the Fissioner's CDF values. More...
 
void retrieveCDFEnergies (float *cdf_energies, int num_bins)
 Fills an input array with the Fissioner's CDF energies. More...
 

Private Attributes

int _num_bins
 
float * _cdf
 
float * _cdf_energies
 
float _E_max
 

Detailed Description

The Fissioner represents the physics of fission neutron emission.

The Fissioner class contains a cumulative distribution function (CDF) for the chi spectrum of fission neutron energies. The Fissioner can stochastically sample from the CDF to generate the neutron fission emisson spectrum. The Watt spectrum given in the "Fundamentals of Nuclear Reactor Physics", E. E. Lewis is used to generate the CDF:

$ \chi = 0.453 * exp(-1.036E) * sinh(\sqrt{2.29E}) $

Constructor & Destructor Documentation

Fissioner::Fissioner ( )

Default Fissioner constructor.

Initializes the Fissioner with 1E5 bins and a maximum emission energy of 20 MeV.

Member Function Documentation

float Fissioner::emitNeutroneV ( )

Sample the Fissioner's CDF and return a neutron energy from fission.

Returns
a neutron energy in eV
See Also
Fissioner::emitNeutronMeV()
float Fissioner::emitNeutronMeV ( )

Sample the Fissioner's CDF and return a neutron energy from fission.

Returns
a neutron energy in MeV
See Also
Fissioner::emitNeutroneV()
int Fissioner::getNumBins ( )

Returns the number of bins that the Fissioner uses for the CDF.

Returns
the number of CDF bins
void Fissioner::retrieveCDF ( float *  cdf,
int  num_bins 
)

Fills an input array with the Fissioner's CDF values.

This class method is a helper function to allow the user to access the CDF array through in Python via SWIG by inputting a numpy array to this function. For example, a user may use this function in Python as follows:

num_cdf_bins = fissioner.getNumBins()
numpy_cdf = numpy.zeros(num_cdf_bins)
fissioner.retrieveCDF(numpy_cdf)
Parameters
cdfan array of the same length as the Fissioner's CDF
num_binsthe length of the input array for the CDF
void Fissioner::retrieveCDFEnergies ( float *  cdf_energies,
int  num_bins 
)

Fills an input array with the Fissioner's CDF energies.

This class method is a helper function to allow the user to access the CDF array through in Python via SWIG by inputting a numpy array to this function. For example, a user may use this function in Python as follows:

num_cdf_energies = fissioner.getNumBins()
numpy_cdf_energies = numpy.zeros(num_cdf_energies)
fissioner.retrieveCDF(numpy_cdf_energies)
Parameters
cdf_energiesan array of the same length as the Fissioner's CDF
num_binsthe length of the input array for the CDF
void Fissioner::setEMax ( float  E_max)

Sets the maximum energy value for the CDF.

Parameters
E_maxthe maximum CDF energy value in MeV
void Fissioner::setNumBins ( int  num_bins)

Sets the number of bins that we wish to use for the CDF.

Parameters
num_binsthe number of CDF bins
float Fissioner::wattSpectrum ( float  energy)

Returns the chi value for a given energy from the Watt spectrum.

Parameters
energya fission energy value in MeV
Returns
the value of chi $\chi$ at that energy

Member Data Documentation

float* Fissioner::_cdf
private

The array of CDF values

float* Fissioner::_cdf_energies
private

The array of CDF energies

float Fissioner::_E_max
private

The maximum fission emission energy in MeV for the CDF

int Fissioner::_num_bins
private

The number of Watt spectrum CDF bins


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