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

The Isotope represents a nuclide at some temperature. More...

#include "pinspec/src/Isotope.h"

Public Member Functions

 Isotope (char *_isotope_name)
 Isotope constructor. More...
 
virtual ~Isotope ()
 Isotope destructor deletes arrays of cross-section values that have been assigned to this isotope.
 
void parseName (char *isotope_name)
 Parse input name and set atomic number for isotope.
 
void makeFissionable ()
 Inform isotope that it is fissionable.
 
char * getIsotopeName () const
 Returns the name of the of isotope. More...
 
int getUid () const
 Returns the unique ID auto-generated for the isotope. More...
 
int getA () const
 Returns the atomic number of this isotope. More...
 
float getAlpha () const
 Returns the alpha $ \alpha = ((A-1)/(A+1))^2 $ values for this isotope. More...
 
float getTemperature () const
 Return the temperature in degrees Kelvin for this isotope. More...
 
float getMuAverage () const
 Return the average value of the cosine of the scattering angle. More...
 
bool isFissionable () const
 Return whether this isotope is fissionable (true) or not (false) More...
 
float getThermalScatteringCutoff ()
 Return the thermal scattering high energy cutoff. More...
 
int getNumXSEnergies (char *xs_type) const
 Returns the number of energies for a particular cross-section type. More...
 
float getElasticXS (float energy) const
 Returns the microscopic elastic scattering cross-section value for some energy. More...
 
float getElasticXS (int energy_index) const
 Returns the microscopic elastic cross-section value for a certain energy index in this isotope's rescaled uniform lethargy grid of cross-section data. More...
 
float getAbsorptionXS (float energy) const
 Returns the microscopic absorption cross-section value for some energy. More...
 
float getAbsorptionXS (int energy_index) const
 Returns the microscopic absorption cross-section value for a certain energy index in this isotope's rescaled uniform lethargy grid of cross-section data. More...
 
float getCaptureXS (float energy) const
 Returns the microscopic capture cross-section value for some energy. More...
 
float getCaptureXS (int energy_index) const
 Returns the microscopic capture cross-section value for a certain energy index in this isotope's rescaled uniform lethargy grid of cross-section data. More...
 
float getFissionXS (float energy) const
 Returns the microscopic fission cross-section value for some energy. More...
 
float getFissionXS (int energy_index) const
 Returns the microscopic fission cross-section value for a certain energy index in this isotope's rescaled uniform lethargy grid of cross-section data. More...
 
float getTotalXS (float energy) const
 Returns the microscopic total cross-section value for some energy. More...
 
float getTotalXS (int energy_index) const
 Returns the microscopic total cross-section value for a certain energy index in this isotope's rescaled uniform lethargy grid of cross-section data. More...
 
float getTransportXS (int energy_index) const
 Returns the microscopic transport cross-section value for a certain energy index in this isotope's rescaled uniform lethargy grid of cross-section data. More...
 
float getTransportXS (float energy) const
 Returns the microscopic transport cross-section value for some energy. More...
 
bool usesThermalScattering ()
 This method returns true if the thermal scattering distributions for this isotope are to be used when sampling outgoing collision energy. More...
 
bool isRescaled () const
 This method returns whether or not the Isotope's cross-sections have been rescaled to a uniform lethargy grid. More...
 
int getEnergyGridIndex (float energy) const
 This method returns the index for a certain energy (eV) into the Isotope's uniform lethargy grid. More...
 
void retrieveXSEnergies (float *energies, int num_xs, char *xs_type) const
 Fills an array with cross-section energy values. More...
 
void retrieveXS (float *xs, int num_xs, char *xs_type) const
 Fills an array with microscopic cross-section values. More...
 
void setElasticXS (double *energies, int num_energies, double *elastic_xs, int num_xs)
 Sets the elastic cross-section data for this isotope. More...
 
void setCaptureXS (double *energies, int num_energies, double *capture_xs, int num_xs)
 Sets the capture cross-section data for this isotope. More...
 
void setFissionXS (double *energies, int num_energies, double *fission_xs, int num_xs)
 Sets the fission cross-section data for this isotope. More...
 
void setMultigroupElasticXS (double *energies, int num_energies, double *elastic_xs, int num_xs)
 Sets the multigroup elastic cross-section data for this isotope. More...
 
void setMultigroupCaptureXS (double *energies, int num_energies, double *capture_xs, int num_xs)
 Sets the multigroup capture cross-section data for this isotope. More...
 
void setMultigroupFissionXS (double *energies, int num_energies, double *fission_xs, int num_xs)
 Sets the multigroup fission cross-section data for this isotope. More...
 
void loadXS (char *xs_type)
 Load the ENDF cross-section data for a particular cross-section from an ASCII file into the appropriate array for this isotope. More...
 
void setA (int A)
 Set the atomic number and update alpha, eta and rho. More...
 
void setTemperature (float T)
 Set the temperature of the isotope in degrees Kelvin. More...
 
void neglectThermalScattering ()
 Informs isotope not to use thermal scattering to sample outgoing collision energies.
 
void setThermalScatteringCutoff (float cutoff_energy)
 Sets the thermal scattering high energy cutoff energy. More...
 
void useThermalScattering ()
 Informs isotope to use thermal scattering to sample outgoing collision energies.
 
Isotopeclone ()
 This method clones a given Isotope class object by executing a deep copy of all of the Isotope's class attributes and giving them to a new Isotope class object. More...
 
void sampleCollisionType (neutron *neutron)
 Determines a random collision type based on the values of each of the isotope's cross-section values at a given enery. More...
 
float getDistanceTraveled (neutron *neutron)
 For a given neutron, this method samples a distance traveled to next collision. More...
 
void collideNeutron (neutron *neutron)
 For a given energy, this method samples a collision type, updates the neutron's outgoing energy and kills the neutron if it sampled absorption or leakage. More...
 
float getThermalScatteringEnergy (float energy)
 For a given neutron energy (eV) in a scattering collision, this function returns the outgoing energy in eV, $ E' $, for the collision based on its thermal scattering distributions. More...
 
int getNumThermalCDFs ()
 Returns the number of thermal scattering CDFs. More...
 
int getNumThermalCDFBins ()
 Returns the number of energy bins for each thermal scattering CDF. More...
 
void retrieveThermalCDFs (float *cdfs, int num_values)
 Loads an input array with the values for each of the isotope's thermal CDFs. More...
 
void retrieveThermalPDFs (float *pdfs, int num_values)
 Loads an input array with the energies for each of the isotope's thermal PDFs. More...
 
void retrieveEtokT (float *E_to_kT, int num_cdfs)
 Loads an input array with the $ \frac{E}{kT} $ values for each thermal scattering CDF. More...
 
void retrieveEprimeToE (float *Eprime_to_E, int num_bins)
 Loads an input array with the $ \frac{E'}{E} $ values for each thermal scattering CDF. More...
 

Private Member Functions

void loadXS ()
 Load the ENDF cross-section data from ASCII files into arrays for this isotope. More...
 
void setElasticXS (float *elastic_xs, float *elastic_xs_energies, int num_elastic_xs)
 Set the elastic cross-section for this isotope. More...
 
void setCaptureXS (float *capture_xs, float *capture_xs_energies, int num_capture_xs)
 Set the capture cross-section for this isotope. More...
 
void setFissionXS (float *fission_xs, float *fission_xs_energies, int num_fission_xs)
 Set the fission cross-section for this isotope. More...
 
void rescaleXS (float start_energy, float end_energy, int num_energies)
 Rescales all of the isotope's cross-sections onto a uniform lethargy grid. More...
 
void generateAbsorptionXS (float start_energy, float end_energy, int num_energies)
 Computes the microscopic absorption cross-section from the isotope's capture and fission (if applicable) cross-sections. More...
 
void generateTotalXS (float start_energy, float end_energy, int num_energies)
 Computes the microscopic total cross-section from the isotope's capture, elastic scatter and fission (if applicable) cross-sections. More...
 
void initializeThermalScattering (float start_energy, float end_energy, int num_bins, int num_distributions)
 This method initializes the probability distributions for thermal scattering. More...
 
float thermalScatteringProb (float E_prime_to_E, int dist_index)
 This function computes the thermal scattering probability for a ratio of initial to final energies. More...
 

Private Attributes

char * _isotope_name
 
int _uid
 
int _A
 
int _A_squared
 
int _A_plus_one_squared
 
float _alpha
 
float _eta
 
float _rho
 
float _AO
 
float _T
 
float _mu_avg
 
bool _fissionable
 
bool _rescaled
 
int _num_elastic_xs
 
float * _elastic_xs
 
float * _elastic_xs_energies
 
bool _elastic_rescaled
 
int _num_capture_xs
 
float * _capture_xs
 
float * _capture_xs_energies
 
bool _capture_rescaled
 
int _num_fission_xs
 
float * _fission_xs
 
float * _fission_xs_energies
 
bool _fission_rescaled
 
int _num_absorb_xs
 
float * _absorb_xs
 
float * _absorb_xs_energies
 
int _num_total_xs
 
float * _total_xs
 
float * _total_xs_energies
 
int _num_energies
 
float _start_lethargy
 
float _end_lethargy
 
float _delta_lethargy
 
bool _use_thermal_scattering
 
float _thermal_cutoff
 
float _kB
 
int _num_thermal_cdfs
 
int _num_thermal_cdf_bins
 
float * _thermal_dist
 
float ** _thermal_cdfs
 
float * _E_to_kT
 
float * _Eprime_to_E
 

Static Private Attributes

static int _n = 1
 

Detailed Description

The Isotope represents a nuclide at some temperature.

The Isotope class represents a nuclide and all of its properties which are relevant to reactor physics calculations.

Constructor & Destructor Documentation

Isotope::Isotope ( char *  isotope_name)

Isotope constructor.

Searches the cross-section library for appropriately named files using the isotope name and loads the capture, scatter, and fission (if file is found) cross-sectoins. By default, the constructor rescales the cross-sections onto a uniform lethargy grid of 100,000 values between 1E-5 eV and 20 MeV. In addition, the constructor creates thermal scattering CDFs for the isotope at 300K by default.

Member Function Documentation

Isotope * Isotope::clone ( )

This method clones a given Isotope class object by executing a deep copy of all of the Isotope's class attributes and giving them to a new Isotope class object.

Returns
a pointer to the new cloned Isotope class object
void Isotope::collideNeutron ( neutron neutron)

For a given energy, this method samples a collision type, updates the neutron's outgoing energy and kills the neutron if it sampled absorption or leakage.

Parameters
neutronthe neutron struct of interest
void Isotope::generateAbsorptionXS ( float  start_energy,
float  end_energy,
int  num_energies 
)
private

Computes the microscopic absorption cross-section from the isotope's capture and fission (if applicable) cross-sections.

This class method computes the absorption cross-section on a uniform lethargy grid.

Parameters
start_energythe highest lethargy value in the grid
end_energythe lowest lethargy value in the grid
num_energiesthe number of energies represented in the grid
void Isotope::generateTotalXS ( float  start_energy,
float  end_energy,
int  num_energies 
)
private

Computes the microscopic total cross-section from the isotope's capture, elastic scatter and fission (if applicable) cross-sections.

This class method computes the total cross-section on a uniform lethargy grid.

Parameters
start_energythe highest lethargy value in the grid
end_energythe lowest lethargy value in the grid
num_energiesthe number of energies represented in the grid
int Isotope::getA ( ) const

Returns the atomic number of this isotope.

Returns
the atomic number
float Isotope::getAbsorptionXS ( float  energy) const

Returns the microscopic absorption cross-section value for some energy.

Uses linear interpolation to compute the cross-section at a a certain energy (eV).

Parameters
energythe energy (eV) of interest
Returns
the microscopic absorption cross-section
float Isotope::getAbsorptionXS ( int  energy_index) const

Returns the microscopic absorption cross-section value for a certain energy index in this isotope's rescaled uniform lethargy grid of cross-section data.

Parameters
energy_indexthe index into the energy array
Returns
the microscopic absorption cross-section
float Isotope::getAlpha ( ) const

Returns the alpha $ \alpha = ((A-1)/(A+1))^2 $ values for this isotope.

Returns
alpha
float Isotope::getCaptureXS ( float  energy) const

Returns the microscopic capture cross-section value for some energy.

Uses linear interpolation to compute the cross-section at a a certain energy (eV).

Parameters
energythe energy (eV) of interest
Returns
the microscopic absorption cross-section
float Isotope::getCaptureXS ( int  energy_index) const

Returns the microscopic capture cross-section value for a certain energy index in this isotope's rescaled uniform lethargy grid of cross-section data.

Parameters
energy_indexthe index into the energy array
Returns
the microscopic capture cross-section
float Isotope::getDistanceTraveled ( neutron neutron)

For a given neutron, this method samples a distance traveled to next collision.

Parameters
neutronthe neutron struct of interest
Returns
the distance traveled
float Isotope::getElasticXS ( float  energy) const

Returns the microscopic elastic scattering cross-section value for some energy.

Uses linear interpolation to compute the cross-section at a a certain energy (eV).

Parameters
energythe energy (eV) of interest
Returns
the microscopic elastic scattering cross-section
float Isotope::getElasticXS ( int  energy_index) const

Returns the microscopic elastic cross-section value for a certain energy index in this isotope's rescaled uniform lethargy grid of cross-section data.

Parameters
energy_indexthe index into the energy array
Returns
the microscopic elastic cross-section
int Isotope::getEnergyGridIndex ( float  energy) const
inline

This method returns the index for a certain energy (eV) into the Isotope's uniform lethargy grid.

The index computed is that of nearest energy less than or equal to the input energy.

Parameters
energythe energy (eV) of interest
Returns
the index into the uniform lethargy grid
float Isotope::getFissionXS ( float  energy) const

Returns the microscopic fission cross-section value for some energy.

Uses linear interpolation to compute the cross-section at a a certain energy (eV).

Parameters
energythe energy (eV) of interest
Returns
the microscopic fission cross-section
float Isotope::getFissionXS ( int  energy_index) const

Returns the microscopic fission cross-section value for a certain energy index in this isotope's rescaled uniform lethargy grid of cross-section data.

Parameters
energy_indexthe index into the energy array
Returns
the microscopic fission cross-section
char * Isotope::getIsotopeName ( ) const

Returns the name of the of isotope.

Returns
character array with name of isotope
float Isotope::getMuAverage ( ) const

Return the average value of the cosine of the scattering angle.

Returns the average value of cosine of theta for this isotope in a scattering collision: $ \left<\mu\right> = \frac{2}{3A} $

Returns
the average for mu
int Isotope::getNumThermalCDFBins ( )

Returns the number of energy bins for each thermal scattering CDF.

Returns
the number of energy bins per thermal scattering CDF
int Isotope::getNumThermalCDFs ( )

Returns the number of thermal scattering CDFs.

Returns
the number of thermal scattering CDFs
int Isotope::getNumXSEnergies ( char *  xs_type) const

Returns the number of energies for a particular cross-section type.

Returns the number of energies for 'capture', 'elastic', 'fission', 'fission' and 'absorption cross-section types.

Parameters
xs_typea character array for the xs_type
Returns
float Isotope::getTemperature ( ) const

Return the temperature in degrees Kelvin for this isotope.

Returns
the temperature of this isotope
float Isotope::getThermalScatteringCutoff ( )

Return the thermal scattering high energy cutoff.

Returns
the thermal scattering high energy cutoff (eV)
float Isotope::getThermalScatteringEnergy ( float  energy)

For a given neutron energy (eV) in a scattering collision, this function returns the outgoing energy in eV, $ E' $, for the collision based on its thermal scattering distributions.

Parameters
energythe energy of the neutron of interest (eV)
Returns
the outgoing energy (eV)
float Isotope::getTotalXS ( float  energy) const

Returns the microscopic total cross-section value for some energy.

Uses linear interpolation to compute the cross-section at a a certain energy (eV).

Parameters
energythe energy (eV) of interest
Returns
the microscopic total cross-section
float Isotope::getTotalXS ( int  energy_index) const

Returns the microscopic total cross-section value for a certain energy index in this isotope's rescaled uniform lethargy grid of cross-section data.

Parameters
energy_indexthe index into the energy array
Returns
the microscopic total cross-section
float Isotope::getTransportXS ( int  energy_index) const

Returns the microscopic transport cross-section value for a certain energy index in this isotope's rescaled uniform lethargy grid of cross-section data.

The transport cross-section corrects for anisotropic scattering using a linear approximation and is computed as follows:

$ \sigma_{tr} = \sigma_t - \left<\mu\right>\sigma_s $

Parameters
energy_indexthe index into the energy array
Returns
the microscopic transport cross-section
float Isotope::getTransportXS ( float  energy) const

Returns the microscopic transport cross-section value for some energy.

Uses linear interpolation to compute the cross-section at a a certain energy (eV). The transport cross-section corrects for anisotropic scattering and is computed as follows:

$ \sigma_{tr} = \sigma_t - \left<\mu\right>\sigma_s $

Parameters
energythe energy (eV) of interest
Returns
the microscopic transport cross-section
int Isotope::getUid ( ) const

Returns the unique ID auto-generated for the isotope.

Returns
a unique ID for the isotope
void Isotope::initializeThermalScattering ( float  start_energy,
float  end_energy,
int  num_bins,
int  num_distributions 
)
private

This method initializes the probability distributions for thermal scattering.

It takes in arguments for the starting energy and end energy (ratios of kT) and the number of distributions which it uses to generate logarithmically spaced energies for the distributions.

Parameters
start_energythe first distribution's energy (ratio of kT)
end_energythe final distribution's energy (ratio of kT)
num_binsthe number of bins per distribution
num_distributionsthe number of scattering distributions
bool Isotope::isFissionable ( ) const

Return whether this isotope is fissionable (true) or not (false)

Returns
whether this isotope is fissionable
bool Isotope::isRescaled ( ) const

This method returns whether or not the Isotope's cross-sections have been rescaled to a uniform lethargy grid.

Returns
whether or not the cross-sections have been rescaled
void Isotope::loadXS ( )
private

Load the ENDF cross-section data from ASCII files into arrays for this isotope.

This method finds the appropriate ENDF data files for the isotope in the PINSPEC cross-section library based on the user-defined name of the isotope. If the appropriate files are not found the method will return an exception. If only capture and elastic scattering cross-section data files are discovered in the cross-section library then the isotope is not fissionable; otherwise if a fission cross-section file is found then the isotope is fissionable. Finally, after all cross-sections are parsed in from data files, this method computes a total cross-section and an absorption cross-section and then rescales all cross-sections onto a uniform lethargy grid to allow for fast O(1) data lookup.

void Isotope::loadXS ( char *  xs_type)

Load the ENDF cross-section data for a particular cross-section from an ASCII file into the appropriate array for this isotope.

This method finds the appropriate ENDF data file for the isotope in the PINSPEC cross-section library based on the user-defined name of the isotope as well as the type of cross-section input ('capture' 'elastic', or 'fission'). If the appropriate file is not found the method will return an exception. Finally, after the cross-section is parsed in from the data file, this method recomputes a total cross-section and an absorption cross-section and then rescales all cross-sections onto a uniform lethargy grid to allow for fast O(1) data lookup.

Parameters
xs_typea character array for the cross-section type
void Isotope::rescaleXS ( float  start_energy,
float  end_energy,
int  num_energies 
)
private

Rescales all of the isotope's cross-sections onto a uniform lethargy grid.

Cross-section rescaling is useful because it allows for a fast O(1) table lookup (and linear interpolation) to compute cross-section values for any given energy.

Parameters
start_energythe highest lethargy value in the grid
end_energythe lowest lethargy value in the grid
num_energiesthe number of energies represented in the grid
void Isotope::retrieveEprimeToE ( float *  Eprime_to_E,
int  num_bins 
)

Loads an input array with the $ \frac{E'}{E} $ values for each thermal scattering CDF.

This method is intended to make data available to the PINSPEC user in Python. Although this function appears to require two input arguments, in reality it only requires one argument for the array in Python. This method would be called in Python as follows:

num_bins = isotope.getNumThermalCDFBins()
Eprime_to_E = isotope.retrieveEprimeToE(num_bins)
Parameters
Eprime_to_Ean array of $ \frac{E'}{E} $ values
num_binsthe number of bins per thermal scattering CDF
void Isotope::retrieveEtokT ( float *  E_to_kT,
int  num_cdfs 
)

Loads an input array with the $ \frac{E}{kT} $ values for each thermal scattering CDF.

This method is intended to make data available to the PINSPEC user in Python. Although this function appears to require two input argument, in reality it only requires one argument for the array in Python. This method would be called in Python as follows:

num_cdfs = isotope.getNumThermalCDFs()
E_to_kT = isotope.retrieveEtokT(num_cdfs)
Parameters
E_to_kTan array of $ \frac{E}{kT} $ values
num_cdfsthe number of thermal scattering CDFs
void Isotope::retrieveThermalCDFs ( float *  cdfs,
int  num_values 
)

Loads an input array with the values for each of the isotope's thermal CDFs.

This method is intended to make the CDF data available to the PINSPEC user in Python. Although this function appears to require two input arguments - the cdfs array and the length of the array - in reality it only requires one argument for the array in Python. This method would be called in Python as follows:

num_cdfs = isotope.getNumThermalCDFs()
num_bins = isotope.getNumThermalCDFBins()
cdfs = isotope.retrieveThermalCDFs(num_cdfs * num_bins)
Parameters
cdfsan input array for to fill with CDF values
num_valuesthe number of CDF bins multiplied by the number of CDFs
void Isotope::retrieveThermalPDFs ( float *  pdfs,
int  num_values 
)

Loads an input array with the energies for each of the isotope's thermal PDFs.

This method is intended to make the PDF data available to the PINSPEC user in Python. Although this function appears to require two input arguments - the PDFs array and the length of the array - in reality it only requires one argument for the array in Python. This method would be called in Python as follows:

num_cdfs = isotope.getNumThermalCDFs()
num_bins = isotope.getNumThermalCDFBins()
pdfs = isotope.retrieveThermalDistributions(num_cdfs * num_bins)
Parameters
pdfsan input array for to fill with CDF values
num_valuesthe number of CDF bins multiplied by the number of CDFs
void Isotope::retrieveXS ( float *  xs,
int  num_xs,
char *  xs_type 
) const

Fills an array with microscopic cross-section values.

This method is a helper function to allow PINSPEC users to get access to the isotope's nuclear data in Python. A user must initialize a numpy array of the correct size (ie, a float64 array the length of the number of cross-section values) as input to this function. This function then fills the numpy array with the data values for one of the isotope's cross-sections. An example of how this function might be called in Python is as follows:

num_xs = isotope.getNumXSEnergies()
xs = isotope.retrieveXS(num_energies, 'capture')
Parameters
xsan array to fill with the microscopic cross-section data
num_xsthe number of cross-section values
xs_typethe type of cross-section
void Isotope::retrieveXSEnergies ( float *  energies,
int  num_xs,
char *  xs_type 
) const

Fills an array with cross-section energy values.

This method is a helper function to allow PINSPEC users to get access to the isotope's nuclear data in Python. A user must initialize a numpy array of the correct size (ie, a float64 array the length of the number of cross-section values) as input to this function. This function then fills the numpy array with the energy values for the isotope's cross-section data. An example of how this function might be called in Python is as follows:

num_energies = isotope.getNumXSEnergies()
energies = isotope.retrieveXSEnergies(num_energies, 'capture')
Parameters
energiesan array to fill with the cross-section energies
num_xsthe number of cross-section values
xs_typethe type of cross-section
void Isotope::sampleCollisionType ( neutron neutron)

Determines a random collision type based on the values of each of the isotope's cross-section values at a given enery.

Parameters
neutrona pointer to structure the of interest
void Isotope::setA ( int  A)

Set the atomic number and update alpha, eta and rho.

Computes alpha, eta, rho and mu as follows:

$ \alpha = \left(\frac{A-1}{A+1}\right)^2 $ $ \eta = \left(\frac{A+1}{2\sqrt{A}}\right)^2 $ $ \rho = \left(\frac{A-1}{2\sqrt{A}}\right)^2 $

Parameters
Athe isotope's atomic number
void Isotope::setCaptureXS ( float *  capture_xs,
float *  capture_xs_energies,
int  num_capture_xs 
)
private

Set the capture cross-section for this isotope.

Parameters
capture_xsa float array of microscopic capture cross-sections
capture_xs_energiesa float array of energies (eV)
num_capture_xsthe number of capture cross-section
void Isotope::setCaptureXS ( double *  energies,
int  num_energies,
double *  capture_xs,
int  num_xs 
)

Sets the capture cross-section data for this isotope.

This is a helper function for users to assign the cross-section data for an isotope from a numpy array in Python. Although the prototype for this function seems to require four arguments - two with arrays of data for energies and cross-sections and two for the length of each array - in Python one must only give the method a handle to each of two arrays. A user may call this method from within Python as follows:

energies = numpy.array([1E-3, 0.1, 1., 10., 1000.])
xs = numpy.array([1000., 1000., 10., 1., 0.1])
isotope.setCaptureXS(energies, xs)
Parameters
energiesan array of energy values
num_energiesthe number of data points
capture_xsthe microscopic elastic cross-section values
num_xsthe number of cross-section values
void Isotope::setElasticXS ( float *  elastic_xs,
float *  elastic_xs_energies,
int  num_elastic_xs 
)
private

Set the elastic cross-section for this isotope.

Parameters
elastic_xsa float array of microscopic elastic cross-sections
elastic_xs_energiesa float array of energies (eV)
num_elastic_xsthe number of elastic cross-section values
void Isotope::setElasticXS ( double *  energies,
int  num_energies,
double *  elastic_xs,
int  num_xs 
)

Sets the elastic cross-section data for this isotope.

This is a helper function for users to assign the cross-section data for an isotope from a numpy array in Python. Although the prototype for this function seems to require four arguments - two with arrays of data for energies and cross-sections and two for the length of each array - in Python one must only give the method a handle to each of two arrays. A user may call this method from within Python as follows:

energies = numpy.array([1E-3, 0.1, 1., 10., 1000.])
xs = numpy.array([1000., 1000., 10., 1., 0.1])
isotope.setElasticXS(energies, xs)
Parameters
energiesan array of energy values
num_energiesthe number of data points
elastic_xsthe microscopic elastic cross-section values
num_xsthe number of cross-section values
void Isotope::setFissionXS ( float *  fission_xs,
float *  fission_xs_energies,
int  num_fission_xs 
)
private

Set the fission cross-section for this isotope.

Parameters
fission_xsa float array of microscopic fission cross-sections
fission_xs_energiesa float array of energies (eV)
num_fission_xsthe number of fission cross-sections values
void Isotope::setFissionXS ( double *  energies,
int  num_energies,
double *  fission_xs,
int  num_xs 
)

Sets the fission cross-section data for this isotope.

This is a helper function for users to assign the cross-section data for an isotope from a numpy array in Python. Although the prototype for this function seems to require four arguments - two with arrays of data for energies and cross-sections and two for the length of each array - in Python one must only give the method a handle to each of two arrays. A user may call this method from within Python as follows:

energies = numpy.array([1E-3, 0.1, 1., 10., 1000.])
xs = numpy.array([1000., 1000., 10., 1., 0.1])
isotope.setFissionXS(energies, xs)
Parameters
energiesan array of energy values
num_energiesthe number of data points
fission_xsthe microscopic fission cross-section values
num_xsthe number of cross-section values
void Isotope::setMultigroupCaptureXS ( double *  energies,
int  num_energies,
double *  capture_xs,
int  num_xs 
)

Sets the multigroup capture cross-section data for this isotope.

This is a helper function for users to assign the cross-section data for an isotope from a numpy array in Python. Although the prototype for this function seems to require four arguments - two with arrays of data for energies and cross-sections and two for the length of each array - in Python one must only give the method a handle to each of two arrays. A user may call this method from within Python as follows:

energies = numpy.array([1E-3, 0.1, 1., 10., 1000., 1E7])
xs = numpy.array([1000., 1000., 10., 1., 0.1])
isotope.setMultigroupCaptureXS(energies, xs)
Parameters
energiesan array of energy bounds
num_energiesthe number of energy bounds
capture_xsthe microscopic capture multigroup cross-sections
num_xsthe number of multigroup cross-sections
void Isotope::setMultigroupElasticXS ( double *  energies,
int  num_energies,
double *  elastic_xs,
int  num_xs 
)

Sets the multigroup elastic cross-section data for this isotope.

This is a helper function for users to assign the cross-section data for an isotope from a numpy array in Python. Although the prototype for this function seems to require four arguments - two with arrays of data for energies and cross-sections and two for the length of each array - in Python one must only give the method a handle to each of two arrays. A user may call this method from within Python as follows:

energies = numpy.array([1E-3, 0.1, 1., 10., 1000., 1E7])
xs = numpy.array([1000., 1000., 10., 1., 0.1])
isotope.setMultigroupElasticXS(energies, xs)
Parameters
energiesan array of energy bounds
num_energiesthe number of energy bounds
elastic_xsthe microscopic elastic multigroup cross-sections
num_xsthe number of multigroup cross-sections
void Isotope::setMultigroupFissionXS ( double *  energies,
int  num_energies,
double *  fission_xs,
int  num_xs 
)

Sets the multigroup fission cross-section data for this isotope.

This is a helper function for users to assign the cross-section data for an isotope from a numpy array in Python. Although the prototype for this function seems to require four arguments - two with arrays of data for energies and cross-sections and two for the length of each array - in Python one must only give the method a handle to each of two arrays. A user may call this method from within Python as follows:

energies = numpy.array([1E-3, 0.1, 1., 10., 1000., 1E7])
xs = numpy.array([1000., 1000., 10., 1., 0.1])
isotope.setMultigroupFissionXS(energies, xs)
Parameters
energiesan array of energy bounds
num_energiesthe number of energy bounds
fission_xsthe microscopic fission multigroup cross-sections
num_xsthe number of multigroup cross-sections
void Isotope::setTemperature ( float  T)

Set the temperature of the isotope in degrees Kelvin.

Parameters
Tthe temperature in degrees Kelvin
void Isotope::setThermalScatteringCutoff ( float  cutoff_energy)

Sets the thermal scattering high energy cutoff energy.

Parameters
cutoff_energythe thermal scattering high energy cutoff energy (eV)
float Isotope::thermalScatteringProb ( float  E_prime_to_E,
int  dist_index 
)
private

This function computes the thermal scattering probability for a ratio of initial to final energies.

Parameters
E_prime_to_Ea ratio of initial to final energies
dist_indexthe distribution of interest
Returns
the probability of the ratio occurring
bool Isotope::usesThermalScattering ( )

This method returns true if the thermal scattering distributions for this isotope are to be used when sampling outgoing collision energy.

Returns
boolean if the thermal scattering distributions exist

Member Data Documentation

int Isotope::_A
private

Atomic number

int Isotope::_A_plus_one_squared
private

Atomic number plus one squared (an optimization for speeup): $ (A+1)^2 $

int Isotope::_A_squared
private

Atomic number squared (an optimization for speedup)

float* Isotope::_absorb_xs
private

Array of microscopic absorption cross-section values

float* Isotope::_absorb_xs_energies
private

Array of absorption cross-section energies (eV)

float Isotope::_alpha
private

$ \alpha = \left(\frac{A-1}{A+1}\right)^2$

float Isotope::_AO
private

Atomic number ratio

bool Isotope::_capture_rescaled
private

Whether or not the capture cross-section is rescaled onto a uniform lethargy grid

float* Isotope::_capture_xs
private

Array of microscopic capture cross-section values

float* Isotope::_capture_xs_energies
private

Array of capture cross-section energies (eV)

float Isotope::_delta_lethargy
private

Space between lethargies in uniform grid

float* Isotope::_E_to_kT
private

Array of the $ \frac{E}{kT} $ values for each PDF/CDF

bool Isotope::_elastic_rescaled
private

Whether or not the elastic scattering cross-section is rescaled onto a uniform lethargy grid

float* Isotope::_elastic_xs
private

Array of microscopic elastic scattering cross-section values

float* Isotope::_elastic_xs_energies
private

Array of elastic scattering cross-section energies (eV)

float Isotope::_end_lethargy
private

Final lethargy for uniform lethargy grid

float* Isotope::_Eprime_to_E
private

Array of $ \frac{E}{E'} $ for each PDF/CDF

float Isotope::_eta
private

$ \eta = \left(\frac{A+1}{2\sqrt{A}}\right)^2 $

bool Isotope::_fission_rescaled
private

Whether or not the fission cross-section is rescaled onto a uniform lethargy grid

float* Isotope::_fission_xs
private

Array of microscopic fission cross-section values

float* Isotope::_fission_xs_energies
private

Array of fission cross-section energies (eV)

bool Isotope::_fissionable
private

Whether isotope is fissionable or not

char* Isotope::_isotope_name
private

The name of the isotope-periodic table name followed by atomic number

float Isotope::_kB
private

Boltzmann's constant

float Isotope::_mu_avg
private

The average cosine of the scattering angle: $ \left<\mu\right> = \frac{2}{3A} $

int Isotope::_n = 1
staticprivate

A static class variable to generate a UID for each new isotope

int Isotope::_num_absorb_xs
private

The number of absorption cross-section data points

int Isotope::_num_capture_xs
private

The number of capture cross-section data points

int Isotope::_num_elastic_xs
private

The number of elastic scattering cross-section data points

int Isotope::_num_energies
private

Number of rescaled cross-section values on uniform lethargy grid

int Isotope::_num_fission_xs
private

The number of fission cross-section data points

int Isotope::_num_thermal_cdf_bins
private

The number of bins per thermal scattering CDFs

int Isotope::_num_thermal_cdfs
private

The number of thermal scattering CDFs

int Isotope::_num_total_xs
private

The number of total cross-section data points

bool Isotope::_rescaled
private

Whether cross-sections are rescaled on uniform lethargy grid

float Isotope::_rho
private

$ \rho = \left(\frac{A+1}{2\sqrt{A}}\right) $

float Isotope::_start_lethargy
private

Starting lethargy for uniform lethargy grid

float Isotope::_T
private

Temperature of the isotope in degrees Kelvin

float** Isotope::_thermal_cdfs
private

2D array of thermal scattering CDFs

float Isotope::_thermal_cutoff
private

The high energy cutoff for the thermal scattering treatment (eV)

float* Isotope::_thermal_dist
private

The number of thermal scattering PDFs

float* Isotope::_total_xs
private

Array of microscopic total cross-section values

float* Isotope::_total_xs_energies
private

Whether or not the total cross-section is rescaled onto a uniform lethargy grid

int Isotope::_uid
private

The isotope's unique identifier

bool Isotope::_use_thermal_scattering
private

Whether or not to use thermal scattering


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