Material Library

Download the full notebook.

material_library

Material Library

PyNE comes with a pre-built library of materials Most of this data comes from a materials compendium by PNNL, which is gives canonical values for normal materials. This notebook demonstrates how to load and use this data via the MaterialLibrary class. First the imports!

In [6]:
# the path to the nuc_data.h5 database
from pyne import nuc_data

# the material library class itself
from pyne.material import MaterialLibrary

The MaterialLibrary class is a dict-like class which maps string names to Material objects. We can instantiate this class directly from the database as follows.

In [7]:
mats = MaterialLibrary(nuc_data, datapath='/material_library/materials', nucpath='/material_library/nucid')

We can also take a gander at the keys in this dictionary.

In [9]:
list(mats.keys())[:10]
Out[9]:
['Mercury',
 'Oil, Crude (Heavy, Qayarah, Iraq)',
 'Sm',
 'Lead',
 'Concrete, M-1',
 'Sc',
 'Iron, Armco Ingot',
 'Freon-13',
 'Concrete, Luminite-colemanite-baryte',
 'Air (dry, near sea level)']

And the values too!

In [10]:
mats['Steel, Stainless 440']
Out[10]:
pyne.material.Material({60120000: 0.006738245111767505, 60130000: 7.897265541693453e-05, 140280000: 0.006030785183179145, 140290000: 0.00031731459880155025, 140300000: 0.0002166284382709865, 150310000: 0.00026258912881006724, 160320000: 0.0001913170536528978, 160330000: 1.5577740060598633e-06, 160340000: 9.094152479801166e-06, 160360000: 2.2657407446809237e-08, 240500000: 0.0071659230051185135, 240520000: 0.1437058558626111, 240530000: 0.016608861068700017, 240540000: 0.004212251977845144, 250550000: 0.006564728220251681, 260540000: 0.0453319840390509, 260560000: 0.7379391848713018, 260570000: 0.017347052627181583, 260580000: 0.002349035618019461, 420920000: 0.0006858785659733434, 420940000: 0.00044131037523069465, 420950000: 0.0007721150950900054, 420960000: 0.0008211250795034776, 420970000: 0.0004778107493212208, 420980000: 0.0012264572134956845, 421000000: 0.0005038988775129898}, 1.0, 7.8, -1.0, {"name":"Steel, Stainless 440"})

You can do everything you normaly would with these materials, like print them out in MCNP form!

In [11]:
print(mats['Steel, Stainless 440'].mcnp())
C name: Steel, Stainless 440
C density = 7.8
m?
     6012 -6.7382e-03
     6013 -7.8973e-05
     14028 -6.0308e-03
     14029 -3.1731e-04
     14030 -2.1663e-04
     15031 -2.6259e-04
     16032 -1.9132e-04
     16033 -1.5578e-06
     16034 -9.0942e-06
     16036 -2.2657e-08
     24050 -7.1659e-03
     24052 -1.4371e-01
     24053 -1.6609e-02
     24054 -4.2123e-03
     25055 -6.5647e-03
     26054 -4.5332e-02
     26056 -7.3794e-01
     26057 -1.7347e-02
     26058 -2.3490e-03
     42092 -6.8588e-04
     42094 -4.4131e-04
     42095 -7.7212e-04
     42096 -8.2113e-04
     42097 -4.7781e-04
     42098 -1.2265e-03
     42100 -5.0390e-04