Skip to content
jessicahunter24 edited this page Apr 15, 2013 · 26 revisions

##DRAFTING##

A material in PINSPEC is made up of one or more isotopes. Creating a material involves initializing it, setting its density and adding the isotopes and their relative densities one at a time. A material can be initialized using the Material constructor, with whatever name the user desires as its argument. This name will be the title to whatever plots are associated with the material.

>>> mix = Material('Fuel Moderator Homogeneous Mix')

The density of the material is set using the setDensity() command with the number density as the first argument and the units as the second argument. The units currently supported are 'g/cc' (grams per cubic centimeter) and 'at/cc' (grams per cubic centimeter).

>>> mix.setDensity(5., 'g/cc')

To check this, or retrieve the density of a material at some later point, one case use the getDensity() command:

>>> mix.getDensity()
5.0

Isotopes are added to materials using the "addIsotope" function, in which isotopes are defined by the name given to them in the isotope initialization section. The relative number density (or atomic ratio) of said isotope is the second argument in the function. Below is an example of adding the isotopes created int he previous tutorial to a single material.

>>> mix.addIsotope(o16, 1.0)
>>> mix.addIsotope(h1, 1.0)
>>> mix.addIsotope(u238, 0.01)
>>> mix.addIsotope(u235, .0025)

To check if that these have been set properly, or to check that a material contains an isotope, use the containsIsotope() commands, which takes the isotope handle as an argument and returns true or false:

>>> mix.containsIsotope(u235)
True
>>> mix.containsIsotope(zr90)
False

Note that the second command will return false ONLY if the isotope was created, but not added to the material. If the isotope in question hasn't been initialized as an isotope yet, this will return a python error, but in either case, you'll know it is incorrect.

##Retrieving Macroscopic Cross Sections One property worth retrieving from a material is the macroscopic cross section. Once a material is defined, all the isotopes and their cross sections are used in conjunction with their number densities to create macroscopic data.

Next: Regions

Tutorials

Home

Clone this wiki locally