OpenMC/tests/regression_tests/enrichment/test.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
1 KiB
Python
Raw Permalink Normal View History

2016-10-26 07:45:59 -04:00
import os
import sys
2016-10-25 20:54:56 -04:00
import numpy as np
2016-10-26 07:45:59 -04:00
from openmc import Material
from openmc.data import NATURAL_ABUNDANCE, atomic_mass
def test_enrichment():
2016-10-25 20:54:56 -04:00
# This test doesn't require an OpenMC run. We just need to make sure the
# element.expand() method expands Uranium to the proper enrichment.
2016-10-26 07:45:59 -04:00
uranium = Material()
2016-10-25 20:54:56 -04:00
uranium.add_element('U', 1.0, 'wo', 4.95)
densities = uranium.get_nuclide_densities()
2016-10-25 20:54:56 -04:00
sum_densities = 0.
for nuc in densities.keys():
assert nuc in ('U234', 'U235', 'U236', 'U238')
2016-10-25 20:54:56 -04:00
sum_densities += densities[nuc][1]
2016-10-25 20:54:56 -04:00
# Compute the weight percent U235
enrichment = densities['U235'][1] / sum_densities
assert np.isclose(enrichment, 0.0495, rtol=1.e-8)
2016-10-25 20:54:56 -04:00
# Compute the ratio of U234/U235
u234_to_u235 = densities['U234'][1] / densities['U235'][1]
assert np.isclose(u234_to_u235, 0.0089, rtol=1.e-8)
2017-10-04 21:06:28 -05:00
# Compute the ratio of U236/U235
u236_to_u235 = densities['U236'][1] / densities['U235'][1]
assert np.isclose(u236_to_u235, 0.0046, rtol=1.e-8)