import openmc

## Materials

## fuel (partially enriched uranium):

## 1200 F pg. 17 MSRE Design and Operations, part III, Nuclear Analysis
temperature = 1200
fuel = openmc.Material(name="MSRE Fuel")
fuel.set_density("g/cm3", 2.146)
fuel.temperature = (1200-32)*5/9
fuel.add_nuclide('Li6', 0.0005, 'wo')
fuel.add_nuclide('Li7', 10.9, 'wo')
fuel.add_nuclide('F19', 66.8, 'wo')
fuel.add_nuclide('Be9', 6.27, 'wo')
fuel.add_element('Zr', 10.92, 'wo')
fuel.add_nuclide('U235', 1.67, 'wo')
fuel.add_nuclide('U238', 3.44, 'wo')

## Moderator graphite
## p. 87 msr operations (robertson) part i
## 1200 F, pg. 17 MSRE Design and Operations, part iii, nuclear analysis
moder = openmc.Material(name="Graphite Moderator")
moder.set_density("g/cc", 1.86)
moder.temperature = (1200-32)*5/9
moder.add_nuclide('B10', 1.592e-5, 'wo')
moder.add_nuclide('B11', 6.408e-5, 'wo')
moder.add_element('V', 0.0009, 'wo')
moder.add_element('S', 0.0005, 'wo')
moder.add_element('C', 99.9852, 'wo')
moder.add_s_alpha_beta(name='C_graphite')
## ignoring the oxygen b/c low content and XS

## Hastelloy Tank
tank = openmc.Material(name="MSRE Tank")
tank.set_density("g/cc", 8.86)
tank.temperature = (1200-32)*5/9
tank.add_nuclide('Si30', 0.00030872, 'wo')
tank.add_nuclide('W186', 0.0014215, 'wo')
tank.add_nuclide('Mn55', 0.008, 'wo')
tank.add_nuclide('W184', 0.001532, 'wo')
tank.add_nuclide('W183', 0.0007155, 'wo')
tank.add_nuclide('W182', 0.001325, 'wo')
tank.add_nuclide('Ni58', 0.4721201092, 'wo')
tank.add_nuclide('Mo92', 0.023744, 'wo')
tank.add_nuclide('Fe58', 0.000141, 'wo')
tank.add_nuclide('Mo94', 0.0148, 'wo')
tank.add_nuclide('Mo95', 0.025472, 'wo')
tank.add_nuclide('Mo96', 0.026688, 'wo')
tank.add_nuclide('Mo97', 0.01528, 'wo')
tank.add_nuclide('Mo98', 0.038608, 'wo')
tank.add_nuclide('Fe56', 0.045877, 'wo')
tank.add_nuclide('Fe57', 0.0010595, 'wo')
tank.add_nuclide('Fe54', 0.0029225, 'wo')
tank.add_nuclide('Mo100', 0.015408, 'wo')
tank.add_nuclide('Si28', 0.00922297, 'wo')
tank.add_nuclide('Si29', 0.00046832, 'wo')
tank.add_nuclide('Cr50', 0.0030415, 'wo')
tank.add_nuclide('Cr52', 0.0586523, 'wo')
tank.add_nuclide('Cr53', 0.0066507, 'wo')
tank.add_nuclide('Cr54', 0.0016555, 'wo')
tank.add_nuclide('Cu65', 0.00107905, 'wo')
tank.add_nuclide('Cu63', 0.00242095, 'wo')
tank.add_nuclide('Ni64', 0.0064191286, 'wo')
tank.add_nuclide('Ni61', 0.0079053205, 'wo')
tank.add_nuclide('Ni60', 0.1818598208, 'wo')
tank.add_nuclide('Ni62', 0.025205621, 'wo')

## Control rod absorber material
## operations report i; p. 102
## 70wtpct gad III oxide, 30wtpct al III oxide
ctrlPois = openmc.Material(name='Control Rod Absorbers')
ctrlPois.set_density("g/cc", 5.873)
ctrlPois.temperature = (1200-32)*5/9
ctrlPois.add_element('Gd', 0.003862068965517241, 'ao')
ctrlPois.add_nuclide('Al27', 0.005884660651235779, 'ao')
ctrlPois.add_nuclide('O16', 0.014620094425129529, 'ao')

air = openmc.Material(name='Air')
air.set_density("g/cc", 0.001225)
air.temperature = (1200-32)*5/9
air.add_nuclide('O16', 0.21, 'ao')
air.add_nuclide('N14', 0.79, 'ao')

surf11 = openmc.Surface(id='11',bound=inf)
surf12 = openmc.Surface(id='12',bound=inf)
surf13 = openmc.Surface(id='13',bound=inf)
surf14 = openmc.Surface(id='14',bound=inf)

cell1 = openmc.Cell(id='111', material=fuel, bound=-11)
cell1 = openmc.Cell(id='112', material=moder, bound=-12)
cell1 = openmc.Cell(id='113', material=tank, bound=-13)
cell1 = openmc.Cell(id='114', material=ctrlPois, bound=-14)
cell1 = openmc.Cell(id='115', material=air, bound=-15)

##### Single Unit Cell

## 4 Bounding planes of stringer
surf1 = openmc.XPlane(x0=-2.54)
surf2 = openmc.XPlane(x0=2.54)
surf3 = openmc.YPlane(y0=-2.54)
surf4 = openmc.YPlane(y0=2.54)

## 4 square cylinders form slot edges
surf5 = openmc.ZCylinder()








## MSR Cluster
msr = openmc.Universe(name='MSR2G-partially-enriched-U-full-core')




