Skip to content
samuelshaner edited this page Mar 31, 2013 · 26 revisions

It is always encouraged to begin a section with a log message using "py_printf()". Here it would be pertinent to use a message describing which material is being initialized. After the log message, a material must be initialized with whatever name the user desires as its argument. This name will be the title to whatever plots are associated with the material. The density of the material is also set in this section, with the number density as the first argument in the "setDensity" function and the units as the second argument. The only units currently supported are g/cc.

A material in PINSPEC can be made up of one or more isotopes, each with a relative number density. 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 of said isotope is the second argument in the function, which is set to 1 by default when the second argument is omitted.

    py_printf('INFO', 'Initializing fuel-moderator mix material...')

    # Define materials
    mix = Material('Fuel Moderator Mix')
    mix.setDensity(5., 'g/cc')
    mix.addIsotope(b10, .0000001)
    mix.addIsotope(o16, 1.0)
    mix.addIsotope(h1, 1.0)
    mix.addIsotope(u238, 0.01)
    mix.addIsotope(u235, .0025)
    mix.addIsotope(zr90, .16)

Return to Creating Input Files

Tutorials

Home

Clone this wiki locally